lib/geoblacklight/geometry.rb
# Generate a wsen bounding box from the geometry
# @return [String] bounding box as comma delimited wsen "w, s, e, n"
Generate a wsen bounding box from the geometry
Generate a wsen bounding box from the geometry
def bounding_box
      obj = factory.parse_wkt(geometry_as_wkt)
      bbox = obj.envelope
      minx = bbox.coordinates[0][0][0]
      miny = bbox.coordinates[0][0][1]
      maxx = bbox.coordinates[0][1][0]
      maxy = bbox.coordinates[0][2][1]
      "#{minx}, #{miny}, #{maxx}, #{maxy}"
    rescue RGeo::Error::ParseError
      Geoblacklight.logger.warn "Error parsing geometry: #{geom}"
      default_extent
    end
def bounding_box obj = factory . parse_wkt ( geometry_as_wkt ) bbox = obj . envelope minx = bbox . coordinates [ 0 ] [ 0 ] [ 0 ] miny = bbox . coordinates [ 0 ] [ 0 ] [ 1 ] maxx = bbox . coordinates [ 0 ] [ 1 ] [ 0 ] maxy = bbox . coordinates [ 0 ] [ 2 ] [ 1 ] "#{minx}, #{miny}, #{maxx}, #{maxy}" rescue RGeo :: Error :: ParseError Geoblacklight . logger . warn "Error parsing geometry: #{geom}" default_extent end
Generate a wsen bounding box from the geometry
Generate a wsen bounding box from the geometry
# Get the minimum bounding box for the geometry as a Polygon # Return as wsen string
bounding box as comma delimited wsen "w, s, e, n"
bounding box as comma delimited wsen " w s e n "
String