[postgis-users] JtsBinaryWriter and SRIDs

P.Rizzi Ag.Mobilità Ambiente paolo.rizzi at ama-mi.it
Mon Mar 27 04:25:24 PST 2006


Hi list,
I started using the JtsBinaryWriter class (and its counterpart
JtsBinaryParser)
to write JTS Geometries (and read them) to (from) Postgis.
Inside JtsBinaryWriter the SRID to write is taken from
geom.getFactory().getSRID()
instead of geom.getSRID().
This probably makes sense in most cases, but not always.
While it's true that it's better to have geometries with uniform SRIDs
inside a Postgis table, 
I don't think it's "strictly" mandatory and it should be already checked by
a "CHECK"
on the table itself.

Anyway I run into this problem because I'm reading geometries from Oracle
and writing
them to Postgis (and viceversa for that matter). The SRID we use is coded as
3003 (EPSG)
inside Postgis and as 82087 (Oracle) inside Oracle, but they actually are
the very same thing,
so I have no need to do any expensive transformation on the geometries, just
set the SRID code.

I can set the SRID of the geometry instances, but not the one of their
factory and,
since JtsBinaryWriter uses the one from the factory, I cannot change it.

I will workaround this, but I believe JtsBinaryWriter should use
geom.getSRID() instead,
or at least it should be configurable.

Bye
Paolo Rizzi




AVVERTENZE AI SENSI DEL D. LGS. 196/2003  
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
file/s allegato/i, sono da considerarsi strettamente riservate. Il loro
utilizzo è consentito esclusivamente al destinatario del messaggio, per le
finalità indicate nel messaggio stesso. Qualora riceveste questo messaggio
senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia
via e-mail e di procedere alla distruzione del messaggio stesso,
cancellandolo dal Vostro sistema; costituisce comportamento contrario ai
principi dettati dal D. Lgs. 196/2003 il trattenere il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse.



More information about the postgis-users mailing list