Subscribe to this thread
Home - General / All posts - Problem with GML import
marcus25 post(s)
#11-Jan-22 17:48

Hi,

I am having an issue with importing some GML files provided by the Ordnance Survey in GB. Some of the node values take the following form: xlink:href="somevalue"; for example:

<net:endNode xlink:href="#osgb4000000068098770"/>

<net:startNode xlink:href="#osgb4000000068098789"/>

When these are imported, all the values in the table for the affected column (e.g. the columns endNode and startNode) are NULL. All other nodes import fine.

Marcus

Dimitri


6,899 post(s)
#12-Jan-22 08:01

For niche uses like this, Manifold can read through GDAL/OGR. What happens when you try that?

marcus25 post(s)
#14-Jan-22 18:40

Thanks. On reflection, I think it's better that I use dedicated tools that are available to import the dataset into PostgreSQL and access it in Manifold from there.

Dimitri


6,899 post(s)
#14-Jan-22 19:04

PostgreSQL is certainly cool, but don't those tools use GDAL as well for such imports?

marcus25 post(s)
#15-Jan-22 11:20

There's a QGIS package specifically to import Ordnance Survey MasterMap into PostgreSQL that does the job very efficiently:

https://www.lutraconsulting.co.uk/projects/ostranslator-ii/

What it's using under the hood I don't know.

Dimitri


6,899 post(s)
#15-Jan-22 12:10

It uses GDAL. You can see that from the source code to it at https://github.com/lutraconsulting/ostranslator-ii

self.process.start('ogr2ogr', self.args)

        if not self.process.waitForStarted():

            raise Exception('Failed to start process. Please ensure you have gdal/ogr2ogr installed')

Have you tried the GDAL dataport in Manifold?

Sounds like a direct import into Manifold would be easier than to first install PostgreSQL, and then launch QGIS, use a plug-in to import the data into PostgreSQL, and then connect to that from Manifold.

marcus25 post(s)
#15-Jan-22 20:18

I tried the GDAL dataport and it drops the columns that Manifold had imported with NULL values. Incidently, this is exactly the same as happens when opening the files in QGIS via add vector (which presumably uses GDAL) - some columns are missing from the data. In contrast, when using OS Translator II all fields are present in the relevant PostgreSQL table.

Dimitri


6,899 post(s)
#16-Jan-22 14:23

Yes, QGIS depends on GDAL.

You might want to look into the OS Translator II source to see how it uses GDAL. Note that there's been a lot of discussion in the GDAL community about xlink:href in GML files. That also could be a source of useful tips for how to use GDAL to acquire the field you want.

adamw


9,821 post(s)
online
#18-Jan-22 14:05

We mostly do not parse data references for GML, correct. We recently started parsing them for XML-based formats though, eg, we parse them for various KML constructs. We could do the same for GML. Could you point us to example GML data that you are trying to work with and / or send a couple of example files to tech support? That would help.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.