Ticket #1535 (closed defect: worksforme)
Mapserver postgis driver unable to read EWKB properly
| Reported by: | szekerest | Owned by: | refractions |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PostGIS Interface | Version: | 4.6 |
| Severity: | critical | Keywords: | |
| Cc: |
Description
Mapserver postgis driver unable to read EWKB properly, eg. geometries with
embedded SRID.
(For example after using ogr2ogr with -a_srs parameter to load data into a
postgis table).
I haven't found a documentation about postgis EWKB representation only a
proposal at:
http://postgis.refractions.net/pipermail/postgis-devel/2004-
December/000710.html
it seems that EWKB stores extra information in the upper bits of the geometry
type (eg. SRID presence flag) which have't taken into account by
mapserver, so the geometries will not be displayed at all.
The problem might be corrected by applying a mask on the upper bits in
mappostgis.c before checking the type of the feature. For example
at line 938
if(type == 3) {
/* polygon */
shape->type = MS_SHAPE_POLYGON;
might be replaced with
if(type & 0x1FFFFFFF == 3) {
/* polygon */
shape->type = MS_SHAPE_POLYGON;
Tamas Szekeres
Change History
Note: See
TracTickets for help on using
tickets.
