Timeline for Transform GeoJSON geometry to WKB
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 22, 2019 at 21:12 | comment | added | Jose Hermosilla Rodrigo | Please @josemi, you should check other answer than mine in favour of community. | |
Feb 22, 2019 at 21:10 | comment | added | Jose Hermosilla Rodrigo | This shouldn't be the correct answer as there are better answers as @Richard Law. This query works but it's not the better/ recommended way. | |
S Apr 27, 2016 at 20:15 | history | suggested | Michael come lately | CC BY-SA 3.0 |
Fix the prettyprint language.
|
Apr 27, 2016 at 20:10 | review | Suggested edits | |||
S Apr 27, 2016 at 20:15 | |||||
Apr 27, 2016 at 19:55 | comment | added | alphabetasoup |
-1 Using ST_SetSRID is simpler, faster and clearer that converting from WKB to text and back again. Moreover, the data isn't in 4326 so this will set an incorrect SRID. You can check this by inspecting the WKT of the result: despite the result being in EPSG 4326, the coordinates are clearly not latitude and longitude (first coordinate is -125045.483512,4577567.5881417 ).
|
|
Apr 27, 2016 at 15:10 | comment | added | Jose Hermosilla Rodrigo | You're right! PostGIS has a specific method to append the SRID as you mention in your post and this is the right way. But I wanted to share this approach that works and it's a simple way. | |
Apr 27, 2016 at 14:54 | comment | added | Lee Hachadoorian |
I have to disagree with this manner of assigning the SRID. There is an ST_SetSRID function which takes a geometry and an SRID, so rather than nesting ST_GeomFromText(ST_AsText(...), <srid>) you should use ST_SetSRID(ST_GeomFromGeoJSON(...), <srid>) .
|
|
Apr 27, 2016 at 14:47 | comment | added | Jose Hermosilla Rodrigo | Glad it help you =) | |
Apr 27, 2016 at 14:38 | comment | added | josemi | Thanks, it is that i wanted, the only finally the SRID not is 4326 is 900913, i changed it and work perfectly | |
Apr 27, 2016 at 14:35 | vote | accept | josemi | ||
Apr 27, 2016 at 14:24 | history | answered | Jose Hermosilla Rodrigo | CC BY-SA 3.0 |