Jez,<br><br>If you don't have any xlinks in your GML files you can skip a bottle-neck by setting the configuration option GML_SKIP_RESOLVE_ELEMS to ALL. Please note that this is a quick and dirty fix. The code will change shortly.<br>
<br><div class="gmail_quote">On Tue, Jul 13, 2010 at 9:02 PM, Jez Walters <span dir="ltr"><<a href="mailto:Jez.Walters@ipl.com">Jez.Walters@ipl.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Even,<br>
<br>
<br>
My ultimate objective is to read OS MasterMap GML using MapServer, but MapServer skips various fields when reading this GML directly. I don't know if this is a fault with GDAL/OGR or with how MapServer is calling it. In order to overcome this restriction, I've been converting the GML to ESRI Shapefiles using ogr2ogr. Fortunately, MapServer appears to have no difficulty reading ESRI Shapefiles! :-)<br>
<br>
I've been playing with your latest GDAL code and the '-splitlistfields' and '-maxsubfields 1' options let me do this conversion, but it does seem rather slow now. Please don't misunderstand me, but given that GDAL v1.7.2 works too without these options it's difficult to see the gain for what I am trying to achieve.<br>
<br>
Perhaps it would be possible to speed things up by combining the stages that produce the '.resolved.gml' and '.gfs' files?<br>
<div class="im"><br>
<br>
Jez<br>
<br>
<br>
-----Original Message-----<br>
From: Even Rouault [mailto:<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>]<br>
</div><div class="im">Sent: Monday 12 July 2010 22:09<br>
To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
</div><div><div></div><div class="h5">Cc: Jez Walters; 'Martin Daly'<br>
Subject: Re: [gdal-dev] ogr2ogr problem converting UK Ordnance Survey MasterMap<br>
<br>
Jez,<br>
<br>
if you checkout latest GDAL trunk, you'll find a new -splitlistfields option for ogr2ogr that will split fields of type IntegerList, RealList or StringList into as many subfields of single type as necessary. You can also specify -maxsubfields an_integer_value to limit the number of subfields (can be usefull if you just want to keep the first element of the list, or to keep the number of subfields to a reasonable number, as some features from your GML file have a big number of elements in the list)<br>
<br>
Even<br>
<br>
Le Monday 12 July 2010 20:04:00 Even Rouault, vous avez écrit :<br>
> Jez,<br>
><br>
> Yes this is a limitation of the shapefile format (and most drivers,<br>
> PostgreSQL databases being one of the exceptions).<br>
><br>
> Try adding -fieldTypeToString IntegerList,RealList,StringList to your<br>
> ogr2ogr command line. This will transform any field of those types into a<br>
> String field by concatenating the values into a single string (what you can<br>
> see with ogrinfo). Beware that if the list if longer more than a few items,<br>
> there will be a truncation at 80 characters.<br>
><br>
> I'm considering to see if it's practical or not to add an option to ogr2ogr<br>
> to split fields of type *List into several fields of simple type.<br>
><br>
> Best regards,<br>
><br>
> Even<br>
><br>
> PS: For the record, in <a href="http://download.osgeo.org/gdal/daily/" target="_blank">http://download.osgeo.org/gdal/daily/</a>, you can find<br>
> daily snapshots of the source code of the trunk (1.8.0dev) and the 1.7<br>
> stable branch.<br>
><br>
> Le Monday 12 July 2010 18:09:16 Jez Walters, vous avez écrit :<br>
> > Even,<br>
> ><br>
> ><br>
> > I've just rebuilt GDAL/OGR using the latest code from the GDAL 'trunk',<br>
> > but now I get the following error using ogr2ogr to convert an OS<br>
> > MasterMap chunk (e.g.<br>
> > <a href="http://www.ordnancesurvey.co.uk/oswebsite/products/innovations/sampledata" target="_blank">http://www.ordnancesurvey.co.uk/oswebsite/products/innovations/sampledata</a><br>
> >/O SMasterMap_Topo/58116-SX9192-2c1.gz) into ESRI shapefiles:<br>
> ><br>
> > "ERROR 6: Can't create fields of type StringList on shapefile layers."<br>
> ><br>
> > The various fields for which this error is reported do not appear to be<br>
> > in the resultant shapefiles. Unfortunately this makes the new GDAL code<br>
> > unusable for me. :-(<br>
> ><br>
> > Any thoughts?<br>
> ><br>
> ><br>
> > Jez<br>
> ><br>
> ><br>
> > -----Original Message-----<br>
> > From: Even Rouault [mailto:<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>]<br>
> > Sent: Sunday 11 July 2010 11:12<br>
> > To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > Cc: Martin Daly; Peter J Halls; Jez Walters<br>
> > Subject: Re: [gdal-dev] ogr2ogr problem converting UK Ordnance Survey<br>
> > MasterMap<br>
> ><br>
> > Just to inform you that now that the NAS driver is in GDAL trunk, I've<br>
> > been able to port its enhancements to the main GML driver. On the few<br>
> > samples I've tested, OS Mastermap GML files seem to be read correctly<br>
> > now.<br>
> ><br>
> > See <a href="http://trac.osgeo.org/gdal/ticket/3680" target="_blank">http://trac.osgeo.org/gdal/ticket/3680</a><br>
> ><br>
> > Le Friday 02 July 2010 09:04:38 Martin Daly, vous avez écrit :<br>
> > > > Here it is not only GDAL/OGR that has a problem! Currently, I<br>
> > > > know of no importer that can handle this construct, other than the<br>
> > > > tool (from Snowflake) used by OSGB to generate it - and there is also<br>
> > > > the question of onwards storage.<br>
> > ><br>
> > > Not even close, I'm afraid.<br>
> > ><br>
> > > There are plenty of tools to read (all parts of) OS MM:<br>
> > ><br>
> > > <a href="http://www.ordnancesurvey.co.uk/oswebsite/products/osmastermap/informat" target="_blank">http://www.ordnancesurvey.co.uk/oswebsite/products/osmastermap/informat</a><br>
> > >io n/ technical/software.html<br>
> > ><br>
> > > e.g. (an excellent one, at a very reasonable price...)<br>
> > ><br>
> > > <a href="http://www.ordnancesurvey.co.uk/oswebsite/products/osmastermap/informat" target="_blank">http://www.ordnancesurvey.co.uk/oswebsite/products/osmastermap/informat</a><br>
> > >io n/ technical/software/cadcorp.html<br>
> > ><br>
> > > Also, as far as I am aware, OS GB use in-house software to generate the<br>
> > > data.<br>
> > ><br>
> > > Martin<br>
<br>
<br>
</div></div><div><div></div><div class="h5">The information transmitted is intended only for the person<br>
or entity to which it is addressed and may contain<br>
confidential and/or privileged material. If you are not the<br>
addressee, any disclosure, reproduction, copying,<br>
distribution, or other dissemination or use of this<br>
communication is strictly prohibited. If you have received<br>
this transmission in error please notify the sender<br>
immediately and then delete this email.<br>
<br>
Any representations or commitments expressed in this email<br>
are subject to contract.<br>
<br>
This message has been scanned for viruses and dangerous<br>
content. However, it is essential that the recipient also<br>
checks this message using commercially available mail<br>
scanning and anti-virus software. IPL Information Processing<br>
Limited accepts no liability for any loss or damage resulting<br>
from any virus or other dangerous content in this message.<br>
<br>
IPL Information Processing Limited is registered in England<br>
and Wales under company registration number 1418818.<br>
Registration took place at Cardiff on 10 May 1979. IPL<br>
Information Processing Limited's registered office and<br>
normal place of business is Eveleigh House, Grove Street,<br>
Bath, BA1 5LR, United Kingdom. IPL is also registered for<br>
Value Added Tax (VAT) under registration number GB 601 2931 83.<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9494447584<br>17.2416N 80.1426E<br>