lib/geoblacklight/geometry.rb
def envelope_to_polygon
      exp = /^\s*ENVELOPE\(
                  \s*([-.\d]+)\s*,
                  \s*([-.\d]+)\s*,
                  \s*([-.\d]+)\s*,
                  \s*([-.\d]+)\s*
                  \)\s*$/x # uses 'x' option for free-spacing mode
      bbox_match = exp.match(geom)
      minx, maxx, maxy, miny = bbox_match.captures
      "POLYGON ((#{minx} #{maxy}, #{minx} #{miny}, #{maxx} #{miny}, #{maxx} #{maxy}, #{minx} #{maxy}))"
    end
# Convert WKT ENVELOPE string to WKT POLYGON string
# @return [String]
Convert WKT ENVELOPE string to WKT POLYGON string
Convert WKT ENVELOPE string to WKT POLYGON string
def envelope_to_polygon
      exp = /^\s*ENVELOPE\(
                  \s*([-.\d]+)\s*,
                  \s*([-.\d]+)\s*,
                  \s*([-.\d]+)\s*,
                  \s*([-.\d]+)\s*
                  \)\s*$/x 
      bbox_match = exp.match(geom)
      minx, maxx, maxy, miny = bbox_match.captures
      "POLYGON ((#{minx} #{maxy}, #{minx} #{miny}, #{maxx} #{miny}, #{maxx} #{maxy}, #{minx} #{maxy}))"
    end
def envelope_to_polygon exp = / ^ \s *ENVELOPE \( \s *([-. \d ]+) \s *,
                   \s *([-. \d ]+) \s *,
                   \s *([-. \d ]+) \s *,
                   \s *([-. \d ]+) \s *
                   \) \s *$ /x bbox_match = exp . match ( geom ) minx , maxx , maxy , miny = bbox_match . captures "POLYGON ((#{minx} #{maxy}, #{minx} #{miny}, #{maxx} #{miny}, #{maxx} #{maxy}, #{minx} #{maxy}))" end
Convert WKT ENVELOPE string to WKT POLYGON string
Convert WKT ENVELOPE string to WKT POLYGON string
# uses 'x' option for free-spacing mode
None
String