0

I have csv files with polygon data in geojson form where each line in the csv is similar to that shown below:

{"type": "Feature", "properties": {},"geometry": {"type": "Polygon","coordinates": [[[-80.86249607459162, 26.200956843221704], [-80.86270930028365, 26.200960980745556], [-80.86271370674712, 26.200778163395427], [-80.86250049530878, 26.200774026141644], [-80.86249607459162, 26.200956843221704]]]}}

I need to add these to a postgreSQL database (and ultimately a gdb) but I have no idea how. Please, any help? Sorry, new to postgreSQL.

Angie
  • 1
  • 2
  • Does this answer your question? [How can I import a JSON file into PostgreSQL?](https://stackoverflow.com/questions/39224382/how-can-i-import-a-json-file-into-postgresql) – Jack Deeth Oct 20 '22 at 17:41
  • If you have a text file where every line is a single JSON object, then that's a text file full of JSON objects, not a .csv file. – Jack Deeth Oct 20 '22 at 17:44
  • Thanks Jack. I also found this: https://gis.stackexchange.com/questions/142391/storing-geojson-featurecollection-to-postgresql-with-postgis which is more specific to geojson, but it keeps telling me it's expecting a , or ] Instead of { in the very first line. Maybe because it's over 7 years old? :( – Angie Oct 20 '22 at 20:15
  • My only interaction with any PostgreSQL database is to forlornly dispatch SELECT statements at one though the back end of SAP BusinessObjects so I don't know what built-in text/JSON-parsing tools it offers. Are you able to process this file e.g. with Python before passing it to PostgreSQL? It might be easier if you could split the file into separate JSON objects upstream and give them to PostgreSQL one at a time. – Jack Deeth Oct 20 '22 at 20:40
  • 1
    I am much better with Python, I think I'll give that a try :) – Angie Oct 21 '22 at 11:14

0 Answers0