5

I've got a problem importing XML data in QGIS Wein.

I've exported the XML data from an interactive PDF map viewed in Adobe Acrobat Pro DC.

When I try to import the XML file into QGIS using the LandXML plugin I get the following error message:

"Problem importing xml 'name'"

I've got no idea how to solve this. I've been reading up how to import XML data into QGIS but I haven't found another way.

XML layout

  • Can you update your question to show the structure of the XML you are trying to import. Is your XML LandXML? – nmtoken Apr 13 '16 at 20:54
  • Hi there. The XML data I'm extracting through Adobe Pro is from this PDF. The data looks awesome in the PDF and I would really like to be able to use it in QGIS... mapre.lbl.gov/wp-content/uploads/2015/07/… – LiamSA Apr 14 '16 at 6:13
  • It is not LandXML data. – LiamSA Apr 14 '16 at 6:19
  • Related: How to save in a given XML schema in QGIS? – carnendil Apr 14 '16 at 6:37
  • So if the data isn't LandXML, then any tool based on its structure isn't going to work. I don't have Adobe Acrobat Pro so I can't see the structure of the XML you have exported, but you do. so if you could as requested edit your question to show the XML structure, it might help us to suggest a way of importing the data; the top few lines would be OK. I see too that in the PDF you reference it says: Spatial data used in this interactive map can be downloaded from the MapRE or the Global Atlas websites. Have you tried downloading it? – nmtoken Apr 14 '16 at 7:33
3

XML files can hold any kind of data. If a software like QGIS should be able to read it, the software (or the developer) needs to know the XML schema of the data.

QGIS is able to read Openstreetmap XML data, and (with the LandXML plugin) data provided by Land Information New Zealand.

If you need support for other XML sources, you might have to do it on your own, or pay a developer to do it for you.

Currently, there seems to be no effort for supporting Adobe XML files in QGIS or GDAL.

The PDF file you linked in the comment can be opened in QGIS and GDAL as a raster file, but not as a vector file. You may extract the map data with

gdal_translate PDF:4:southAfrica_interactive_MapRE.pdf

but that has only a poor resolution.

You can use https://superuser.com/questions/302045/how-to-extract-vectors-from-a-pdf-file, and save from inkscape to DXF format. That way you get the geometry into QGIS, but you have to georeference the data yourself using the countries borders.

  • Hey, thanks for the help. The XML data is from this PDF. I wish there was a way to effectively extract all the shapefile data!!! mapre.lbl.gov/wp-content/uploads/2015/07/… – LiamSA Apr 14 '16 at 6:16
  • See my extended answer. – AndreJ Apr 14 '16 at 7:16
  • Hi. Thanks for the update. I tried using Inkscape to open the PDF and I get this error: "GLib-ERROR **: gmem.c:239: failed to allocate 1118208 bytes aborting... This application has requested the Runtime to terminate it in an unusual way" – LiamSA Apr 14 '16 at 7:48
  • Besides trying to get the XML data to work, perhaps you could advise me on what to do with the shapefile data that the website provides. It's incomprehensible to me, which is why I started trying to extract the same data from the PDF they provide. The shapefile data is available at mapre.lbl.gov/country/south-africa - and I am trying to view the "Projects PV" file, with little success. As I stated in my response above, the attribute table is incomprehensible and the shapefile data doesn't reflect the data viewed in the PDF. Thanks for your help. – LiamSA Apr 14 '16 at 7:58
  • I used pdftocairo from the poppler utiities under Windows to etxract just page 4, and it worked for me. QGIS did not like the svg output, but inkscape could transform it into dxf format which was readable by QGIS. – AndreJ Apr 14 '16 at 11:18

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.