Ideally GML documents should include a schema definition using
xsi:schemaLocation but they rarely do. If they did you could use the XML
parser to find that location and then parse the schema (not an easy task)
and then map it automatically to a FeatureSchema. Again not an easy task as
GML is hierarchical and JUMP is not.

Have a look at the spec there are some examples in there.

http://www.opengeospatial.org/standards/gml

A GML document contains a single feature, which typically will be a feature
collection (feature collections are features).

<?xml version="1.0" encoding="UTF-8"?>
<CityModel xmlns="http://www.opengis.net/examples";
xmlns:gml="http://www.opengis.net/gml";
xmlns:xlink="http://www.w3.org/1999/xlink";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.opengis.net/examples city.xsd">
<gml:name>Cambridge</gml:name>
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
<gml:coord><gml:X>0.0</gml:X><gml:Y>0.0</gml:Y></gml:coord>
<gml:coord><gml:X>100.0</gml:X><gml:Y>100.0</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<cityMember>
<River>
<gml:description>The river that runs through Cambridge.</gml:description>
<gml:name>Cam</gml:name>
<gml:centerLineOf>
<gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
<gml:coord><gml:X>0</gml:X><gml:Y>50</gml:Y></gml:coord>
<gml:coord><gml:X>70</gml:X><gml:Y>60</gml:Y></gml:coord>
<gml:coord><gml:X>100</gml:X><gml:Y>50</gml:Y></gml:coord>
</gml:LineString>
</gml:centerLineOf>
</River>
</cityMember>
<cityMember>
<Road>
<gml:name>M11</gml:name>
<linearGeometry>
<gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
<gml:coord><gml:X>0</gml:X><gml:Y>5.0</gml:Y></gml:coord>
<gml:coord><gml:X>20.6</gml:X><gml:Y>10.7</gml:Y></gml:coord>
<gml:coord><gml:X>80.5</gml:X><gml:Y>60.9</gml:Y></gml:coord>
</gml:LineString>
</linearGeometry>
<classification>motorway</classification>
<number>11</number>
</Road>
</cityMember>
<cityMember xlink:type="simple" xlink:title="Trinity Lane"
xlink:href="http://www.foo.net/cgi-bin/wfs?FeatureID=C10239";
gml:remoteSchema="city.xsd#xpointer(//[EMAIL PROTECTED]'RoadType'])"/>
<!-- a mountain doesn't belong here! Uncomment this cityMember and see
the parser complain!
<cityMember>
<Mountain>
<gml:description>World's highest mountain is in Nepal!</gml:description>
<gml:name>Everest</gml:name>
<elevation>8850</elevation>
</Mountain>
</cityMember>
-->
<dateCreated>2000-11</dateCreated>
</CityModel>

You'll also need to learn about namespaces

I found the JUMP templating code for GML confusing and never really had much
luck with it.

Your best bet is to find some tool to convert from GML into a simpler format

Paul

On Thu, Sep 18, 2008 at 3:57 PM, Sunburned Surveyor <
[EMAIL PROTECTED]> 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
>



-- 
Paul Austin
President/CEO
Revolution Systems Inc.

+1 (604) 288-4304 x201
www.revolsys.com
-------------------------------------------------------------------------
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