Opened 12 years ago
Closed 11 years ago
#593 closed defect (worksforme)
WKB Should output SRID of 0
Reported by: | cfis | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 3.3.6 |
Component: | Default | Version: | 3.3.5 |
Severity: | Unassigned | Keywords: | |
Cc: |
Description
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:
void WKBWriter::writeSRID(int SRID) {
if (includeSRID && SRID != 0)
writeInt(SRID);
}
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?
Absence of SRID is considered to be the same as SRID=0 by PostGIS. What does your
postgis_full_version()
say ?