<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 05/28/2013 11:40 PM, Even Rouault
wrote:<br>
</div>
<blockquote
cite="mid:201305282240.20555.even.rouault@mines-paris.org"
type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Le mardi 28 mai 2013 19:47:38, Ari Jolma a
écrit :</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> On 05/28/2013 05:34 PM, Lauri Kajan
wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > Hi Ari,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > I think that shouldn't be
neccessary.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > The gml file points to the xsd
schema file</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> >
(<a class="moz-txt-link-freetext" href="http://xml.nls.fi/XML/Schema/Maastotietojarjestelma/MTK/201202/Maastotie">http://xml.nls.fi/XML/Schema/Maastotietojarjestelma/MTK/201202/Maastotie</a></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > dot.xsd). In this schema those tags
are defined to be "aliases" for these</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > known gml tags by using the
substitutionGroup. So actually that</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > <Maastotiedot> is a
<gml:FeatureCollection>. Is this supported by OGR?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> I think GDAL wants the xsd to be local
file for GML files. However, I</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> tried this and I can see GDAL finding
the xsd, but failing the overall</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> process. Further, it seems that GDAL
does not recognize the XML include</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> tag.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> Anyway, I assume it is not a simple
substitution as all features should</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> be wrapped into gml:featureMember
elements.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Lauri,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Generic GML reading is a very complicated
task, since it can model very complex data organizations that
cannot be represented trivially in the OGR data model. Basically
the GML reader in OGR is limited to GML documents respecting
Simple Feature profiles ( <a moz-do-not-send="true"
href="http://portal.opengeospatial.org/files/?artifact_id=15201"><span
style=" text-decoration: underline; color:#0057ae;">GML
3.1.1 simple features profile - OGC(R) 06-049r1</span></a>
). The XSD parser in the GML reader has similar limitations.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">The GML reader only tries to analyze the .xsd
if it has the same basename as the .gml document. Starting with
OGR 1.10, you can specify as datasource name something like
"foo.gml,xsd=bar.xsd". In that instance, Maastotiedot.xsd is too
complex for the XSD parser to be analyzed. And as the naming of
elements in the GML doesn't match the hard coded convention of
the OGR GML driver ("somethingMember" elements, usual names for
GML geometry elements), the autodiscovery of the schema fails
also.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">However when looking at the GML itself, it
should be possible with moderate tweaking to make the GML driver
aware of the structure of that particular schema (provided that
it is worth the effort, i.e. there are a significant number of
GML files following that schema, which must likely be the case
if it is a sample of the National Land Suvey of Finnish), since
it is close from what it can understand currently. It has
already been done in similar situations.</p>
</blockquote>
<br>
<br>
I'm cc'ing Pekka Sarkola, as I remember him asking about this a
while back.<br>
<br>
Even, by tweaking I hope you mean tweaking the GML itself? As I
believe (being quite ignorant of / unexperienced with XSLT) that
with a simple XSLT the XML could be made readable by GDAL. Again,
being unexperienced with XSLT, I'm not sure but hope that XSLT
processors run in sequential mode, thus the reading could be
conveniently handled with a pipe. Hmm, how would that actually work,
I'm not sure(?).<br>
<br>
Anyway, if and when this is *the* GML format NLS Finland uses to
serve its data, it would be worthwhile to develop a publishable
solution.<br>
<br>
Cheers,<br>
<br>
Ari<br>
<br>
<br>
<blockquote
cite="mid:201305282240.20555.even.rouault@mines-paris.org"
type="cite">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Best regards,</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Even</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">-- </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Geospatial professional services</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><a class="moz-txt-link-freetext" href="http://even.rouault.free.fr/services.html">http://even.rouault.free.fr/services.html</a></p>
</blockquote>
<br>
</body>
</html>