-
Notifications
You must be signed in to change notification settings - Fork 112
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
[Bug report] SQLite rejects negative coordinates when column has srid=4326 #516
Comments
Aha, digging deeper, the cause of the upset seems to be that I'm specifying the SRID on the column, but it's unset on the geometry. Is this the expected behaviour when that occurs? The documentation doesn't go into much detail on how it interacts. (I'm also now unsure if this is GeoAlchemy logic or Spatialite logic - apologies if it's the latter) |
Trying to take that knowledge back to my actual code, I was surprised to find that explicitly setting the SRID on my geometry when calling The issue seems to be that the The underlying cause is that |
Same root cause as #509, it seems. Fairly simple to do an incremental fix to the WKT regex. However, with this being the second issue, the relative simplicity of the regex, and the potential complexity of WKT strings, I'm worried that there remain plenty of undiscovered issues and the regex probably needs a significant revision by someone who's far more familiar with WKT parsing than I am. For another example, a
|
Hi @DFEvans |
Is it worth emitting a warning/log message? Thinking of something in the |
Indeed, let's add a warning here. |
The new release |
Describe the bug
When using spatialite, inserting a geometry with negative coordinates to a column with srid=4326 is rejected as it "violates Geometry constraint [geom-type or SRID not allowed]", even though the coordinates supplied should be valid for WGS84.
Optional link from https://geoalchemy-2.readthedocs.io which documents the behavior that is expected
https://geoalchemy-2.readthedocs.io/en/stable/spatialite_tutorial.html
To Reproduce
Error
Additional context
From reading elsewhere, rejecting negative coordinates is expected behaviour if a column has an undefined
srid
. However, I think I'm defining it correctly - if nothing else, the raw SQL emitted to create the table includes the expected4326
in the call toRecoverGeometryColumn
.The linked tutorial for Spatialite use doesn't explicitly show the use of SRID or state that they're supported, but equally, it doesn't mention any restrictions on compatibility vs. a PostGIS-backed database.
GeoAlchemy 2 Version in Use
0.15.1
Python Version
3.10
Operating system
Linux
The text was updated successfully, but these errors were encountered: