Opened 10 years ago

Closed 9 years ago

#3630 closed enhancement (fixed)

Add gml:xlink support to OGR's GML driver

Reported by: chaitanya Owned by: chaitanya
Priority: normal Milestone: 1.8.0
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: GML xlink
Cc: warmerdam, pcav

Description

This ticket it to describe the work on GML driver to add support for xlinks and the geometries TopoCurve?, TopoSurface? and MultiCurve?. The code for MultiCurve? interpretation is adapted from the patch provided by Andrea Peri.

Developed by Chaitanya kumar CH (chaitanya@…) for Faunalia (http://www.faunalia.it) with funding from Regione Toscana - Sistema Informativo per la Gestione del Territorio e dell' Ambiente [RT-SIGTA]". For the project: "Sviluppo di prodotti software GIS open-source basati sui prodotti QuantumGIS e Postgis (CIG 037728516E)

Attachments (1)

MultiCurve.diff (11.5 KB) - added by chaitanya 10 years ago.
For reference: the patch to interpret MultiCurve? geometry elements provded by Andrea Peri.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 10 years ago by chaitanya

Status: newassigned

Committed the changes in trunk in r19840.

Some tests should be added to the autotest suite when some test data is available.

comment:2 Changed 10 years ago by chaitanya

Fixed crashing condition by rouault in r19844 in trunk.

comment:3 Changed 10 years ago by Even Rouault

r19852 /trunk/gdal/ogr/ogrsf_frmts/gml/resolvexlinks.cpp: GML xlink resolver : Fix memory leak when GML file is XML invalid

comment:4 Changed 10 years ago by Even Rouault

r19854 fix 2 memory use related errors

First one : in TrimTree?(), the iteration on psChild->psNext was wrong since CPLDestroyXMLNode() would invalidate the psChild object, so the fix is to save the next pointer before and assigning it to psChild at the end of the for body

Second one : FindTreeByURL() : a CPLRealloc() was done on papsRoot, but this could change the base address of the array, so the caller must see it

comment:5 Changed 10 years ago by Even Rouault

r19856 : use regular CPLDestroyXMLNode() after optimization done in r19855

Changed 10 years ago by chaitanya

Attachment: MultiCurve.diff added

For reference: the patch to interpret MultiCurve? geometry elements provded by Andrea Peri.

comment:6 Changed 10 years ago by pcav

Cc: pcav added

comment:7 Changed 9 years ago by Even Rouault

r20029 /trunk/gdal/ogr/ogrsf_frmts/gml/ (6 files): GML reader: unlink temporary .resolved.gml file generated by CPLGenerateTempFilename()

r20030 /trunk/gdal/ogr/ogrsf_frmts/gml/ (ogrgmldatasource.cpp resolvexlinks.cpp): Avoid useless attempts to save .gfs and .resolved.gml files in read-only filesystems

r20033 /trunk/gdal/ogr/ogrsf_frmts/gml/ogrgmldatasource.cpp: GML xlink resolver: don't try to resolve again xlinks if .resolved.gml file already exists and is more recent than .gml file

comment:8 in reply to:  7 Changed 9 years ago by chaitanya

Replying to rouault:

r20029 /trunk/gdal/ogr/ogrsf_frmts/gml/ (6 files): GML reader: unlink temporary .resolved.gml file generated by CPLGenerateTempFilename()

Even, For large gml files this process takes time. I have been looking for a good way to save the resolved file only in special cases. Yours is better than mine.

comment:9 Changed 9 years ago by Even Rouault

The r20029 change is just the removing of the temp file at the end of the process, to avoid pollution of the working directory.

I've also noticed that the xlink resolver takes big amount of time, but also memory as it loads the whole file into memory (my conf is particularly tight on memory), as soon as the GML files is bigger than several tens of megabytes. I'm wondering if it wouldn't be better to turn off xlink resolution by default and have people explicitely turn it on ?

comment:10 Changed 9 years ago by chaitanya

Added some corrections, additions, changes and a test in trunk (r) The resolution is turned off by default.

One way to increase speed is to create an index of the elements with a "gml:id" attribute for each GML resource. But this could be a big overhead in some cases. The indexes have to be built every time a file is opened.

comment:11 Changed 9 years ago by chaitanya

Added some corrections, additions, changes and a test in trunk (r20083)

comment:12 Changed 9 years ago by Even Rouault

Milestone: 1.8.11.8.0
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.