Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add support for 3D/4D postgis geometries #44

Closed
artemp opened this Issue · 3 comments

3 participants

@artemp
Owner

See [https://lists.berlios.de/pipermail/mapnik-users/2007-October/000439.html thread on Mapnik users mailing list].

And http://support.mapbox.com/discussions/tilemill/7787-postgis-layer-loads-but-features-are-empty

The PostGIS plugin/WKB reader assumes that geometries are in 2D. Though not standard OGC, PostGIS supports 3D/4D. There are two ways to fix this in Mapnik :

  1. Add support for 3D/4D Geometries in wkb reader

  2. Use force_2D inside postgis plug-in

@artemp
Owner

[artem] The third way is to use 'force_2D' in SQL :

(select name, type, force_2D(the_geom) as the_geom from roads) as roads_2d;
@nlebedev

FYI ST_AsBinary(), which is called by Mapnik, doesn't drop M dimension. I suppose it doesn't drop Z too, but haven't yet tried on 3D data.
I've tested this:

select st_astext(st_geomfromwkb(st_asbinary(geom))) from m_geom;

for MULTILINESTRING M geometry in geom and the result was MULTILINESTRING M type, so it reconstructs wkt from wkb with the proper number of dimensions.

This leads to mapnik not rendering geometries with M dimension, and the only workaround yet is do a preliminary ST_Force_2D in a db.

@springmeyer
Owner

assigning to 2.3.x milestone - need to at least throw an error or handle more gracefully so this is not a totally silent problem.

@springmeyer springmeyer referenced this issue from a commit
@springmeyer springmeyer add support for rendering (vs skipping) 3D and 4D postgis geometries …
…like POINTZM, LINESTRINGZM, and POLYGONZM - closes #44
83c0db3
@springmeyer springmeyer referenced this issue from a commit
@springmeyer springmeyer add #44 to changelog fef45cb
@springmeyer springmeyer closed this
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.