on 2015 Jul 16 6:35 PM
Hi,
I need to determine the distance between a location specified by GPS coordinates and a polygon defined by multiple GPS coordinates. According to the documentation and other posts on this forum, this can be done by converting the data from SRID 4326 (used by GPS systems) to a local plannar SRID and then use the ST_Distance method. Since my data is in Canada, I found 2 SRID that I should be able to use : 3347 and 3348.
My problem is I can't figure out how to transform the data from SRID 4326 to SRID 3347 or 3348. I am using the following code : select new ST_Point(45.566964, -73.753816).ST_SRID(4326).ST_Transform(3347);
I tried with many coordinates around Canada and I get either one of the following errors using Interactive SQL version 16.0.0, build 1948 : --Error 1: Value 59830836.670898 out of range for coordinate x (SRS bounds [2365553.332100, 6624202.315400] exceeded by more than 50%) SQLCODE=-1484, ODBC 3 State="HY000" --Error 2: Failed to transform point (55.307676,-115.330497) (error -14) SQLCODE=-1532, ODBC 3 State="HY000"
Also, I configured my database to use the SRID 3347 and 3348 using the "Create Spacial Reference System Wizard".
Is there something I am missing or is this a problem in SQL Anywhere?
Thanks
Try reversing your longitude/latitude. SRID 4326 expects coordinates in longitude, latitude order, but you are giving latitude, longitude.
select new ST_Point( -73.753816, 45.566964, 4326 ).ST_Transform(3347)
Point (7615498.02129 1247511.99533)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.