R: [postgis-users] JtsBinaryWriter and SRIDs
Markus Schaber
schabi at logix-tt.com
Mon Mar 27 05:59:24 PST 2006
Hi, Paolo,
P.Rizzi Ag.Mobilità Ambiente wrote:
> I never used JTS before, so I didn't know that. Anyway it seems sensible to
> me
> that they have un-deprecated them, but I may be wrong...
> In any case I submitted a similar message to the JTS list, because I have
> the
> same issue with their OracleWriter class, so I may have an answer from that
> part.
Oh, I'm subscribed on jts-devel list, too, but currently about 70
messages behind.
But to solve your original problem, you may also copy the
spatial_ref_sys entry in PostGIS to contain the oracle SRID (or
vice-versa), then you have consistent SRID in your whole system:
insert into spatial_ref_sys (srid, auth_name, auth_srid, srtext,
proj4text) SELECT 82087, 'oracle', 82087, srtext, proj4text FROM
spatial_ref_sys WHERE srid=3003;
> I do this for two reasons: the first is to avoid the dependency on Trove,
I also dislike the dependency on Trove, but using boxed integer
variables for the java.util HashMap key seemed to be worse.
> Note that we're talking about the JtsBinaryWriter, not the JtsBinaryParser,
> so the two SRIDs may already be different.
Okay, changing the BinaryWriter, but leaving the Parser "as_is" would be
an option.
> When you'll re-read them, the two will be equal, because each geometry
> will be built by the same factory, with the same SRID.
Yes. This would break when the parser is reworked to re-use a single
factory, and then setSRID() on the geometries, as my code initially was.
> Anyway, for the writer, the behaviour could be configurable,
> so the default would be to use the factory SRID, but use the instance SRID
> upon request.
Yes, that's a possibility. However, for the JDBC driver extending case,
we currently don't have any easy way to pass configuration parameters to
the Factory. The whole type extension concept is crying for beeing
reworked, IMHO.
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
More information about the postgis-users
mailing list