Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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?

share|improve this answer
add comment

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

Good job.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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