0

I can't find documentation as to the formats allowed for lat/long in data files for cartoDB maps? Should Lat/long be in decimal form, as deg/min/sec or geocoded as lat/long?

IOW is there a list of lat/long formats that cartoDB will understand if passed in a CSV or JSON file?

I think there's a presumption that is one is starting from a GIS context and thus already know the answer. I'm not!

1

CartoDB recognizes and uses degrees in decimal form.

You can try to go to the map view in an empty table an draw a point (right toolbar, bottom button, "add feature") and then go back to your table to see how the coordinates were saved in the the_geom column.

In your CSV, I recommend you to have two columns: one for latitude and other for longitude. If you call them latitude/longitude, or lat/long, or any other similar terms, the system will recognize those columns and will plot them directly in a map.

If you have your coordinates in a "lat, long" format (in a single column), I recommend you to create in your CartoDB table a column for latitude, other for the longitude, and use these queries:

UPDATE _tablename_ SET _latitude_ = split_part(_coordinates_, ', ', 1)

UPDATE _tablename_ SET _longitude_ = split_part(_coordinates_, ', ', 2)

(The words between _ refer to column names (or table name), so you should change them accordingly). This way you can process easily your data from CartoDB without having to manually edit all the values.

| improve this answer | |
  • Thanks, I'll give that a go. Might I suggest this useful nugget go somewhere in cartodb.com/docs as it's pretty fundamental to getting started. – mwra Feb 25 '15 at 13:56
  • We have this: docs.cartodb.com/… but I'll add another one about the format of the coordinates :-) Thanks! – iriberri Feb 25 '15 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.