If you create a point dataset in CartoDB then export it to CSV, you get a "the_geom" column in the WKB format. How do you get individual lat
and lon
columns?
Add a comment
|
Since CartoDB uses PostGIS, you can use PostGIS functions:
- On the SQL tab (Map View), modify the default query to look something like this:
SELECT *,
ST_X(the_geom) AS lon,
ST_Y(the_geom) AS lat
FROM mytable
- Under "Edit" select "Export Layer" and choose CSV.
-
If the geom is a polygon, you can export the lat and lon using this: ST_X(ST_Centroid(the_geom)) and ST_Y(ST_Centroid(the_geom)) – ssaltman Aug 31 '17 at 14:21