Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST_SRID() queries return 0 when using WKT/WKB to insert data #5

Closed
boonen opened this issue Mar 11, 2011 · 3 comments
Closed

ST_SRID() queries return 0 when using WKT/WKB to insert data #5

boonen opened this issue Mar 11, 2011 · 3 comments

Comments

@boonen
Copy link

boonen commented Mar 11, 2011

When doing a query, using ST_SRID(), the result is always 0. Since Hibernate Spatial uses this method in its test queries (see below an example query), the GeoDB dialect cannot be made compatible.

A possible solution would be to always store geometries as EWKB, but this probably break the current support for WKB/WKT methods.

Hibernate Spatial query (from test suite):
select geomentity0_.id as col_0_0_, ST_Within(geomentity0_.geom, ST_GeomFromText(?, 4326)) as col_1_0_ from GEOMTEST geomentity0_ where ST_Within(geomentity0_.geom, ST_GeomFromText(?, 4326))=1 and ST_SRID(geomentity0_.geom)=4326

@jdeolive
Copy link
Owner

Hi Jan,

How is the data/geometry being inserted into the table? Any chance you could provide a quick test case to reproduce the issue? With that we should be able to quickly fix. And if you want to whip up a patch even better :)

@boonen
Copy link
Author

boonen commented Mar 14, 2011

Hi Justin,

Let me get back to you next week with a test. I'm willing to supply a
patch, but before I do so, I'd like to discuss the impact with you (I
don't plan to destroy the existing codebase ;-)

Cheers,

Jan

On 11 March 2011 17:32, jdeolive
reply@reply.github.com
wrote:

Hi Jan,

How is the data/geometry being inserted into the table? Any chance you could provide a quick test case to reproduce the issue? With that we should be able to quickly fix. And if you want to whip up a patch even better :)

#5 (comment)

@jdeolive
Copy link
Owner

Hi Jan,

Thinking more about this issue... by default new geometries should be written in EWKB. The only case in which they are not is when an older version of JTS is being used. I had to patch JTS mid 1.12 in order to support writing of the SRID.

Can you confirm which version is being used in the hibernate spatial case? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants