[geos-devel] [GEOS] #593: WKB Should output SRID of 0

GEOS geos-trac at osgeo.org
Mon Sep 24 12:15:36 PDT 2012

#593: WKB Should output SRID of 0
 Reporter:  cfis        |       Owner:  geos-devel@…              
     Type:  defect      |      Status:  new                       
 Priority:  major       |   Milestone:  3.3.6                     
Component:  Default     |     Version:  3.3.5                     
 Severity:  Unassigned  |    Keywords:                            
 Postgis 2.x now assumes that 0 represents an "unknown" srid.  So in our db
 we have an enforce_srid constraint that says the srid should be 0 when
 storing indoor features.

 Problem is geos intentionally doesn't output a 0 srid, here is the code:

 WKBWriter::writeSRID(int SRID)
     if (includeSRID && SRID != 0)

 This breaks our app because when it inserts a record to postgis it sends
 the new geometry using the wkb format.  Since geos doesn't emit the 0
 srid, the enforce constraint fails because the srid isn't set at all (and
 we want it to be 0).

 Could this check be removed to bring geos in line with postgis?

Ticket URL: <http://trac.osgeo.org/geos/ticket/593>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

More information about the geos-devel mailing list