Hi all,
I'm trying to parse a set of AIXM 5.1 features without success.
I followed every guideline and tutorial I was able to find for GT2 +
GML 3 + application schema but I always end up with obscure exceptions
or with the feature being stored on a generic Hashmap.
I also tryied by programmatically setting schema locations for the
document or by using the WFS feature reader but there was nothing to
do.
I think that the problem is gt can't correctly parse the AIXM schema.
Am I missing something?

A most straightforward attempt :

Main :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import org.geotools.gml3.GMLConfiguration;
import org.geotools.xml.Parser;

public class MainXML {
        public static void main(String[] args) {
                try {
                        InputStream in = new FileInputStream(new 
File("C:\\NOTAM\\test.xml"));
                        Parser parser = new Parser(new GMLConfiguration());
                        Object parsedObject = parser.parse(in);
                        System.out.println(parsedObject.getClass().getName());
                        System.out.println(parsedObject);
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


test.xml :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<aixm:AirportHeliport
xmlns:message="http://www.aixm.aero/schema/5.1/message";
xmlns:aixm="http://www.aixm.aero/schema/5.1";
xmlns:event="http://www.aixm.aero/schema/5.1/event";
xmlns:gml="http://www.opengis.net/gml/3.2";
xmlns:xlink="http://www.w3.org/1999/xlink";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:gmd="http://www.isotc211.org/2005/gmd";
xmlns:gco="http://www.isotc211.org/2005/gco";
xsi:schemaLocation="http://www.aixm.aero/schema/5.1/message
http://www.aixm.aero/schema/5.1/message/AIXM_BasicMessage.xsd
http://www.aixm.aero/schema/5.1/event
http://www.aixm.aero/schema/5.1/event/Event_Features.xsd";
gml:id="uuid.c636f0da-f456-4a51-8083-3d583b627442">
        <gml:identifier
codeSpace="urn:uuid">c636f0da-f456-4a51-8083-3d583b627442</gml:identifier>
        <aixm:timeSlice>
                <aixm:AirportHeliportTimeSlice gml:id="AD01_TS01">
                        <gml:validTime>
                                <gml:TimeInstant gml:id="AD01_TS01_TI01">
                                        
<gml:timePosition>2008-12-15T16:00:00</gml:timePosition>
                                </gml:TimeInstant>
                        </gml:validTime>
                        <aixm:interpretation>SNAPSHOT</aixm:interpretation>
                        <aixm:designator>ENSO</aixm:designator>
                        <aixm:name>STORD AIRPORT SORSTOKKEN</aixm:name>
                        
<aixm:locationIndicatorICAO>ENSO</aixm:locationIndicatorICAO>
                        <aixm:designatorIATA>SRP</aixm:designatorIATA>
                </aixm:AirportHeliportTimeSlice>
        </aixm:timeSlice>
        <aixm:timeSlice>
                <aixm:AirportHeliportTimeSlice gml:id="CY01_TS02">
                        <gml:validTime>
                                <gml:TimePeriod gml:id="CY01_TS02_TP01">
                                        
<gml:beginPosition>2008-12-15T16:00:00</gml:beginPosition>
                                        
<gml:endPosition>2008-12-15T17:00:00</gml:endPosition>
                                </gml:TimePeriod>
                        </gml:validTime>
                        <aixm:interpretation>TEMPDELTA</aixm:interpretation>
                        <aixm:sequenceNumber>13</aixm:sequenceNumber>
                        <aixm:availability>
                                <aixm:AirportHeliportAvailability 
gml:id="ACYAVAIL_02">
                                        <aixm:annotation>
                                                <aixm:Note 
gml:id="CY01_TS02_NT01">
                                                        
<aixm:propertyName>operationalStatus</aixm:propertyName>
                                                        
<aixm:purpose>REMARK</aixm:purpose>
                                                        <aixm:translatedNote>
                                                                
<aixm:LinguisticNote gml:id="CY01_TS02_NT02">
                                                                        
<aixm:note lang="eng">FOR INFO CALL +4792665553</aixm:note>
                                                                
</aixm:LinguisticNote>
                                                        </aixm:translatedNote>
                                                </aixm:Note>
                                        </aixm:annotation>
                                        
<aixm:operationalStatus>CLOSED</aixm:operationalStatus>
                                </aixm:AirportHeliportAvailability>
                        </aixm:availability>
                        <aixm:extension>
                                <event:AirportHeliportExtension gml:id="ex01">
                                        <event:theEvent
xlink:href="urn:uuid:f50faa4a-3037-45ea-a69d-5e982d74991a" />
                                </event:AirportHeliportExtension>
                        </aixm:extension>
                </aixm:AirportHeliportTimeSlice>
        </aixm:timeSlice>
</aixm:AirportHeliport>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Output :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
24-giu-2011 12.52.26 org.geotools.xml.impl.ParserHandler startElement
AVVERTENZA: Error parsing:
http://www.aixm.aero/schema/5.1/message/AIXM_BasicMessage.xsd
24-giu-2011 12.52.26 org.geotools.xml.impl.ParserHandler startElement
AVVERTENZA: Error parsing:
http://www.aixm.aero/schema/5.1/event/Event_Features.xsd
24-giu-2011 12.52.26 org.geotools.xml.impl.ParserHandler startElement
AVVERTENZA: Could not find a schema
java.util.HashMap
{id=uuid.c636f0da-f456-4a51-8083-3d583b627442,
timeSlice=[{id=AD01_TS01, name=STORD AIRPORT SORSTOKKEN,
validTime={id=AD01_TS01_TI01, timePosition=2008-12-15T16:00:00},
locationIndicatorICAO=ENSO, designator=ENSO, interpretation=SNAPSHOT,
designatorIATA=SRP}, {extension={id=ex01,
theEvent=urn:uuid:f50faa4a-3037-45ea-a69d-5e982d74991a}, id=CY01_TS02,
validTime={id=CY01_TS02_TP01, beginPosition=2008-12-15T16:00:00,
endPosition=2008-12-15T17:00:00}, interpretation=TEMPDELTA,
sequenceNumber=13,
availability={annotation={propertyName=operationalStatus,
id=CY01_TS02_NT01, translatedNote={id=CY01_TS02_NT02, note={null=FOR
INFO CALL +4792665553, lang=eng}}, purpose=REMARK}, id=ACYAVAIL_02,
operationalStatus=CLOSED}}],
identifier={null=c636f0da-f456-4a51-8083-3d583b627442,
codeSpace=urn:uuid}}

-----------------------------------------------------------------------------------------------------------------------------------------------------------------




Thank you
Errico Demly Chirulli

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to