locationtech / locationtech/geomesa
ST_SetSRID is not possible
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 446
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 31
Description
ST_SetSRID is not possible
We are assuming that the hard code SRID is always 4326, is that correct?
It would be nice if we could change it, for example, using ST_SetSIRD or UpdateGeometrySRID as in PostGIS.
Another possibility would be to set SRID at loading time, for example:
geometry ST_GeomFromText(text WKT);
Should also allow the user to set the SRID.:
geometry ST_GeomFromText(text WKT, integer srid);
Is such functionality in the plans for the up-coming versions?
Original JIRA Issue: https://geomesa.atlassian.net/browse/GEOMESA-2437
Key: GEOMESA-2437
Type: Story
Priority: Major
Status: To Do
Resolution: Unresolved
Reporter: Romulo Goncalves
Created: Mon, 15 Oct 2018 10:24:04 -0400
Updated: Tue, 14 Apr 2020 15:45:50 -0400
Affects Version(s): 2.0.2
JIRA Labels: sql
Comments:
557058:da7f6dfa-f0a1-468b-aec5-2cb61273feb5 (Mon, 15 Oct 2018 11:20:39 -0400):
I don't believe that anyone plans to work on supporting other SRIDs in the persisted features. Currently through geotools you can reproject at ingest and/or query time, so it wouldn't be too hard to wire that through spark with something like:
ST_ProjectFrom(ST_GeomFromText(...), 3857)
select projectTo(geom, 3857) from ...
5bbfa913ec97a853a3f7ffe8 (Mon, 15 Oct 2018 11:51:07 -0400):
Emilio Lahr-Vivaz Something inline with your suggestion would be enough. In that case ST_Transform would solve the problem. However, we do not see it listed in:
https://www.geomesa.org/documentation/user/spark/sparksql_functions.html
557058:da7f6dfa-f0a1-468b-aec5-2cb61273feb5 (Mon, 15 Oct 2018 12:14:22 -0400):
Yes, it doesn't exist, I was suggesting it as an improvement.
5bbfa913ec97a853a3f7ffe8 (Tue, 16 Oct 2018 12:30:55 -0400):
Good point. Is such extension hard to implement?
557058:da7f6dfa-f0a1-468b-aec5-2cb61273feb5 (Tue, 16 Oct 2018 13:22:32 -0400):
I don't think it would be too hard, just creating the new function and delegating to geotools
557058:48912df4-0004-4f90-9915-db26684ec006 (Tue, 14 Apr 2020 15:45:50 -0400):
Should rename this ticket to be for implementing ST_Transform? Or close this ticket and open one for the other function?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no implementation files or tests; start with the Spark SQL functions documentation and locate the existing geometry-function registration and GeoTools integration. Resolve whether the intended scope is SRID assignment, ST_Transform, or both, then define completion as a documented function with coverage for the supported SRID behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- spark, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100