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.

In a weeks time I should be able to transfer the GIS data provided in the XML format to PostgreSQL database. I have prepared the PostgreSQL database (empty) and looking at Matlab scripts. (I am on ubuntu platform).

Matlab is our existing platform.The work is passed on to me by another person who used Mapping tools on MATLAB to export the data to viewers like ArcGIS/Google Earth.This was created for a prototype. (However, in the final product I will be exporting PostgreSQL to QGIS to view the data).

I am pretty new to the GIS data/table.Could you suggest me the steps in-detail to have the data in PostgreSQL?

share|improve this question
add comment

1 Answer

It depends what kind of XML format you have. Do you have GML, KML, GPX or some homegrown XML format? If you are using a standard spatial XML, I would suggest looking at OGR2OGR which is part of GDAL tool kit. It's a commandline tool that can import several formats into PostGIS and other spatial databases and spatial formats. http://www.gdal.org/ogr2ogr.html - you can download binaries from http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries

If you have some homegrown format or are picky about how the conversion is done, you could use the built in functions in PostgreSQL to import the XML and parse it into the fields you want e.g. I use pg_read_file (requires super user rights) to load from filesystem and then the various xpath functions to parse the xml. Here is an example of that approach I wrote about a while ago: http://www.postgresonline.com/journal/archives/116-Loading-and-Processing-GPX-XML-files-using-PostgreSQL.html

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.