So, I have a kml file which contains 317 data points (317 polygons and the respective 317 names). The kml file also contains attribute data which pops up in a bubble on Google earth with about 12 custom data points (Code, name, locality, no. of houses etc.) which could have been loaded onto the kml file using ArcGIS (I'm assuming this, cause I received just the kml file from my source) or could have been custom coded using a text editor.

Now, I'm trying to build a PostGIS db using this data along with the custom data points (attribute data) which is stored in the kml file. I tried converting the kml file to a shapefile to load it onto PostGIS using shp2pgsql, but this ignores all the attribute data. Only the geometry and name gets converted. I also tried converting the KML file to xml/csv/xls format to atleast try and merge the attribute data with the main db on postgresql, but I failed cause there is no converter out there which pulls out all the data from a KML file.

My question is, is there a way to load this kml file with attribute data onto PostGIS? Is there a simpler converter for KML to CSV, or similar spreadsheet formats? What's the best way to do this?

2 Answers 2


I'm not sure what software you're using but when I covert the Google Campus Layer in the Google Sample KML file to a shapefile with QGIS, all the attributes are maintained. What software are you using?


if you want to try to convert directly into csv, you can try this online converter or this opensource project.

Good job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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