That is an unsupported module right? It is an experiment someone in the
community has started - do you want to check the pom.xml file and see
who the contact person is? Perhaps they would like a hand completing it...
Jody
Baroudi Malek wrote:
> Hello lists,
> The gpx module in geotools 2.5-M3 create an empty database with
> (track,point,waypoint) and can't parse correctly the gpx file,is these
> caused by the xml parser of geotools ?
> -Can't support CDATA tags in gpx file.
> -Can't support of extention.
>
> This is my test code :
>
> import java.io.File;
> import java.io.IOException;
> import java.net.URL;
>
> import org.geotools.data.DataStore;
> import org.geotools.data.FeatureSource;
> import org.geotools.data.gpx.GpxDataStoreFactory;
> import org.geotools.feature.FeatureIterator;
> import org.opengis.feature.Feature;
> import org.opengis.feature.simple.SimpleFeature;
> import org.opengis.feature.simple.SimpleFeatureType;
>
> public class GpxDataStore {
> public static void main(String[] args) throws IOException {
>
> File gpx = new File("/home/../Desktop/a.gpx");
> URL url = gpx.toURI().toURL();
> System.out.println(url.toExternalForm());
> DataStore store = new GpxDataStoreFactory().createDataStore(url);
> FeatureSource<SimpleFeatureType, SimpleFeature> points = store
>
> .getFeatureSource(org.geotools.data.gpx.GpxDataStore.TYPE_NAME_POINT);
>
> FeatureIterator<SimpleFeature> it =
> points.getFeatures().features();
> int cnt = 0;
> while (it.hasNext()) {
>
> Feature f = it.next();
> System.out.println(f);
> String[] typeNames = store.getTypeNames();
> System.out.println(typeNames[1]);
> cnt++;
> }
>
> }
> }
>
> -----------(NullPointerException)
> Exception in thread "main" java.lang.NullPointerException
> at java.util.TreeMap.getEntry(TreeMap.java:324)
> at java.util.TreeMap.containsKey(TreeMap.java:209)
> at java.util.TreeSet.contains(TreeSet.java:217)
> at
> org.geotools.data.gpx.GpxDataStore.loadGpxMemoryLocked(GpxDataStore.java:349)
> at org.geotools.data.gpx.GpxDataStore.loadGpx(GpxDataStore.java:295)
> at org.geotools.data.gpx.GpxDataStore.<init>(GpxDataStore.java:146)
> at
> org.geotools.data.gpx.GpxDataStoreFactory.createNewDataStore(GpxDataStoreFactory.java:127)
> at
> org.geotools.data.gpx.GpxDataStoreFactory.createDataStore(GpxDataStoreFactory.java:106)
> at
> org.geotools.data.gpx.GpxDataStoreFactory.createDataStore(GpxDataStoreFactory.java:55)
> at GpxDataStore.main(GpxDataStore.java:23)
>
> --------------(caused by extension tag)
>
> Sep 3, 2008 11:21:13 AM org.geotools.xml.impl.
> ParserHandler startElement
> INFO: Could not find declaration for:
> {http://www.topografix.com/GPX/gpx_style/0/2}line
> <http://www.topografix.com/GPX/gpx_style/0/2%7Dline>. Creating a mock
> element declaration and parsing anyways...
> Sep 3, 2008 11:21:13 AM org.geotools.xml.impl.ParserHandler startElement
> INFO: Could not find declaration for:
> {http://www.topografix.com/GPX/gpx_style/0/2}color
> <http://www.topografix.com/GPX/gpx_style/0/2%7Dcolor>. Creating a mock
> element declaration and parsing anyways...
> Sep 3, 2008 11:21:13 AM org.geotools.xml.impl.ParserHandler startElement
> INFO: Could not find declaration for:
> {http://www.garmin.com/xmlschemas/GpxExtensions/v3}TrackExtension
> <http://www.garmin.com/xmlschemas/GpxExtensions/v3%7DTrackExtension>.
> Creating a mock element declaration and parsing anyways...
> Sep 3, 2008 11:21:13 AM org.geotools.xml.impl.ParserHandler startElement
> INFO: Could not find declaration for:
> {http://www.garmin.com/xmlschemas/GpxExtensions/v3}DisplayColor
> <http://www.garmin.com/xmlschemas/GpxExtensions/v3%7DDisplayColor>.
> Creating a mock element declaration and parsing anyways...
>
> -----------(caused by CDATA tag)
> Exception in thread "main" java.lang.ClassCastException:
> java.util.HashMap cannot be cast to org.geotools.gpx.bean.GpxType
> at
> org.geotools.data.gpx.GpxDataStore.loadGpxMemoryLocked(GpxDataStore.java:324)
> at org.geotools.data.gpx.GpxDataStore.loadGpx(GpxDataStore.java:295)
> at org.geotools.data.gpx.GpxDataStore.<init>(GpxDataStore.java:146)
> at
> org.geotools.data.gpx.GpxDataStoreFactory.createNewDataStore(GpxDataStoreFactory.java:127)
> at
> org.geotools.data.gpx.GpxDataStoreFactory.createDataStore(GpxDataStoreFactory.java:106)
> at
> org.geotools.data.gpx.GpxDataStoreFactory.createDataStore(GpxDataStoreFactory.java:55)
> at GpxDataStore.main(GpxDataStore.java:23)
>
> Thank you in advance.
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> 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=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
-------------------------------------------------------------------------
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=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel