I second Paul's idea about looking at the spec for examples.  You need 
more gunk than is in your example - welcome to the wonderful world of XML...

As for auto-determining input data types, there's two reasons we choose 
to provide a template containing this and other information
- if the input file is empty you still need to know the datatype in 
order to create a layer
- the template made it easier to specify exactly which elements 
contained attribute values. 

You could certainly write code that "guessed" the information contained 
in the template.  In the end internally you'd end up creating a data 
structure which contains exactly the information in the template.  We 
just didn't take the coding this one step further, due to lack of time 
and use cases. 

I agree that the template is a bit complicated - but at least it lets 
you parse a GML file.  You can probably find other tools which does this 
for you a bit more automatically (OGR maybe?).  At the time we wrote 
this code none of these were available.

Sunburned Surveyor wrote:
> I'm doing some work converting GPX files into "waypoint observations"
> stored in GML 2. I want to be able to read the GML 2 files into
> OpenJUMP. I had a couple of questions that I thought you guys could
> help with:
>
> [1] I'm trying to figure out what the "header" of a GML 2 file should
> look like. I'll be buggered if I can't find a good GML 2 sample file
> on the web. Is this what a GM you2 file should look like?:
>
> <gml>
>    <featureCollection>
>       <someFeature>
>          <someAttribute>Some Attribute Value</someAttribute>
>          <someOtherAttribute>Some Other Attribute Value</someOtherAttribute>
>      </someFeature>
>    </featureCollection>
> </gml>
>
> [2] I know that OpenJUMP currently requires the use of an input
> template to read GML. I was wondering if it might be possible to
> automatically determine the attribute data type
> (String/Date/Integer/Double) automatically based on the first
> attribute values encountered in the file. This would eliminate the
> need for an input template and would make it easier to import GML 2
> files. Any thoughts on this?
>
> The Sunburned Surveyor
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to