Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Geos plugin can't determine extents of horizontal or vertical lines #1794

Closed
gravitystorm opened this Issue · 4 comments

2 participants

@gravitystorm

I found this while doing some troubleshooting, but it's not exactly a priority to fix.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" background-color="#ffffff">

<Style name="land">
  <Rule>
    <LineSymbolizer fill-opacity="1.0" fill="#000055" width="10"/>
  </Rule>
</Style>
  <Layer name="land"
  srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
    <StyleName>land</StyleName>
    <Datasource>
       <Parameter name="type">geos</Parameter>
       <Parameter name="wkt">LINESTRING(0 0, 1 0)</Parameter>
    </Datasource>
  </Layer>
</Map>

gives

RuntimeError: GEOS Plugin: cannot determine extent for <wkt> geometry encountered during parsing of layer 'land' in Layer at line 11 of 'foo.xml'

contrast this with the postgis equivalent:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" background-color="#ffffff">

<Style name="land">
  <Rule>
    <LineSymbolizer fill-opacity="1.0" fill="#000055" width="10"/>
  </Rule>
</Style>
    <Layer name="land"
  srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
    <StyleName>land</StyleName>
    <Datasource>
       <Parameter name="type"><![CDATA[postgis]]></Parameter>
       <Parameter name="table"><![CDATA[(select st_geomfromtext('LINESTRING(0 0, 1 0)') as the_geom) as foo]]></Parameter>
       <Parameter name="geometry_field"><![CDATA[the_geom]]></Parameter>
       <Parameter name="dbname"><![CDATA[gis]]></Parameter>
       <Parameter name="srs"><![CDATA[+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over]]></Parameter>
    </Datasource>
  </Layer>
</Map>

which renders fine.

mapnik v2.1.0-995-gfeaf757

@springmeyer
Owner

I think the geos plugin should be deprecated and removed. Please use the CSV plugin with WKT in place of it, or the core wkt parsing functions as part of the mapnik api (which did not exist when the geos plugin was created).

@gravitystorm

I've only ever used the geos plugin for writing testcases, and I haven't heard of anyone else using it.

@springmeyer
Owner

Thanks for the feedback. So, please use the CSV plugin and file any issues you hit with that. No plans to fix the geos plugin. I think we should remove in master (in the 2.2 release).

@springmeyer
Owner

tracking removal of GEOS plugin at #1809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.