Question

So I loaded a bunch of NHD data, and the geometry ended up as MultiPolygonZM (and pointZM and areaZM for other tables)

  way geometry(MultiPolygonZM,900913)

I've tested the query and its returning data when run against the db directly. Here's my style:

<Style name="waterways">
  <Rule>
    <LineSymbolizer stroke="blue" stroke-width="3" />
  </Rule>
</Style>
<Layer name="waterways" status="on">
  <StyleName>waterways</StyleName>
  <Datasource>
    <Parameter name="table">
    (select way
     from nhd_waterbody)
    as waterway
    </Parameter>
    <Parameter name="type">postgis</Parameter>
    <Parameter name="port">5432</Parameter>
    <Parameter name="user">gisuser</Parameter>
    <Parameter name="dbname">gis</Parameter>
    <Parameter name="estimate_extent">false</Parameter>
    <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
  </Datasource>
</Layer>

But I can't get mapnik (version 2.10) to render it. The osm data is rendering just fine (its standard MultiPolygon, not 4d) from mapnik and qgis (v1.8) map all of it just hunky dory. Has anyone else experienced anything like this? Is it a geometry problem or is that just a red herring? Is there anyway to get mapnik to spit out any type of debug info when rendering?

TIA!

-- Randy

Était-ce utile?

La solution

Several GIS programs, such as QGIS, internally use ST_Force_2D to make a 2D drawing from higher-dimension data types. I'm not sure how Mapnik treats these geometries, but I suspect they might not be supported. Also, be sure to double-check the extent, since this is often overlooked.

If you are not actually using the higher dimensions, then remove them! For PostGIS 2.0:

ALTER TABLE my_table
    ALTER COLUMN way TYPE geometry(MultiPolygon,900913) USING ST_Force_2D(way);

And for PostGIS 1.x, see this answer.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top