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_Transform is not working as expected #873

Closed
willome opened this issue Jan 12, 2018 · 3 comments
Closed

ST_Transform is not working as expected #873

willome opened this issue Jan 12, 2018 · 3 comments
Milestone

Comments

@willome
Copy link

willome commented Jan 12, 2018

select ST_AsText(ST_Transform(ST_SetSRID(ST_Point(379550.883, 1815125.223), 4326), 2154)) 

is not throwing any error, but Postgis does : ERROR: transform: couldn't project point (379551 1.81513e+06 0): latitude or longitude exceeded limits (-14).

This has been tested on 1.3.2 and 1.4.0-SNAPSHOT. I saw some bugs which have been fixed on ST_Transform, but it seems a bug is still present.

@nicolas-f
Copy link
Member

Hi,

The explanation for the error is that the latitude and longitude of the provided coordinates are outside the bounds defined by the projection used. The WGS84 projection (4326) is bounded from -180° to +180°.

It seems that you have not provided the correct argument projection for the ST_SETSRID function.

select ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(379550.883, 1815125.223), 2154), 4326));

-- POINT (0.6665174699701417 6.38514521272767) 

@willome
Copy link
Author

willome commented Jan 12, 2018

Well I know that is the wrong projection : the sql example I wrote is erroneous (it was made on purpose) and it just show you that the error is NOT present in H2Gis, but occured as expected with PostGis.

This should throw an error with H2gis, but unfortunately it returns a Point.

select ST_AsText(ST_Transform(ST_SetSRID(ST_Point(379550.883, 1815125.223), 4326), 2154))
```

@ebocher ebocher added this to the H2GIS 1.4.X milestone Jan 15, 2018
@ebocher
Copy link
Member

ebocher commented May 23, 2018

Declared in CTS orbisgis/cts#96

@ebocher ebocher closed this as completed May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants