R: R: [postgis-users] JtsBinaryWriter and SRIDs

Markus Schaber schabi at logix-tt.com
Tue Mar 28 04:16:01 PST 2006

Hi, Paolo,

P.Rizzi Ag.Mobilità Ambiente wrote:

>>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.
> Obviously I have simpler requirements than you, so I didn't considered
> (and I have no reason to) all these aspects...

To be honest, my _personal_ requirements are pretty simple, but as
Maintainer, I have to estimate the requirements of all other users.

> Anyway the fact all geometries from the same Postgis table have
> the same SRID, may be enforced, if needed, at the DB side
> (with a CHECK constraint or something).

Yes, and this is independend from the way the driver fetches his SRID,
because the driver does not have any notion of tables at all. The SQL
query may even process and mangle the geometry in many ways without even
looking at a table at all. :-)

> The Parser may have a similar parameter to specify the desired behaviour.

Yes, that would make sense. I really wish we'd have per connection
settings for this. Maybe we'll have to patch pgJDBC. :-)

>>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.
> ...yes, as I said I have simpler requirements, so I'm sorry 
> I didn't considered this either...

Well, a first step would be to make this configurable in the parser /
writer instance, so at least those who use the parser directly can
configure it the way they want.

And as no one spoke up here on this list, I'd even make the writer
getting the SRID from the geometry the default, because fetching it from
the factory was an ugly (IMHO) workaround for the deprecated getSRID()
in jts 1.6, which I expected to vanish in 1.7 instead of being legalized

I'll have a look into this.

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