lib/utilities/geo.rb
# make a diamond 2 * radius tall and 2 * radius wide, with the reference point as center
# NOT TESTED/USED
# @return [RGeo::Polygon]
make a diamond 2 * radius tall and 2 * radius wide, with the reference point as center
NOT TESTED/USED
make a diamond 2 * radius tall and 2 * radius wide with the reference point as center NOT TESTED / USED
def diamond_error_box
      p0      = geo_object
      delta_x = (error_radius / ONE_WEST) / Math.cos(p0.y * Math::PI / 180)
      delta_y = error_radius / ONE_NORTH
      retval = Gis::FACTORY.polygon(Gis::FACTORY.line_string(
        [Gis::FACTORY.point(p0.x, p0.y + delta_y), 
         Gis::FACTORY.point(p0.x + delta_x, p0.y), 
         Gis::FACTORY.point(p0.x, p0.y - delta_y), 
         Gis::FACTORY.point(p0.x - delta_x, p0.y) 
        ]))
      box    = RGeo::Cartesian::BoundingBox.new(Gis::FACTORY)
      box.add(retval)
      box.to_geometry
    end
def diamond_error_box p0 = geo_object delta_x = ( error_radius / ONE_WEST ) / Math . cos ( p0 . y * Math :: PI / 180 ) delta_y = error_radius / ONE_NORTH retval = Gis :: FACTORY . polygon ( Gis :: FACTORY . line_string ( [ Gis :: FACTORY . point ( p0 . x , p0 . y + delta_y ) , Gis :: FACTORY . point ( p0 . x + delta_x , p0 . y ) , Gis :: FACTORY . point ( p0 . x , p0 . y - delta_y ) , Gis :: FACTORY . point ( p0 . x - delta_x , p0 . y ) ] ) ) box = RGeo :: Cartesian :: BoundingBox . new ( Gis :: FACTORY ) box . add ( retval ) box . to_geometry end
make a diamond 2 * radius tall and 2 * radius wide, with the reference point as center
NOT TESTED/USED
make a diamond 2 * radius tall and 2 * radius wide with the reference point as center NOT TESTED / USED
# north # east # south # west
None
RGeo::Polygon