Hello Johann and all
Thanks for the update on GPX reader. As Johann said, this reader is not
yet connected to the public API, in part because the
org.apache.sis.storage.DataStore API is not yet completed (it is
currently merely about getting the metadata). Given that we are a little
bit short before the ApacheConf North America (in 3 weeks) and that I
think it would be desirable to have a SIS release before, I would
suggest to wait after ApacheConf before to merge that code to trunk. The
code would stay on the JDK8 branch; we would not move it elsewhere. We
would just delay its merging by about one month. Likewise I suggest to
also delay the merging of the new org.apache.sis.filter package for the
same reason.
On a related note, Rémi started work in the sis-referencing module for
improving the support of georeferenceable images (i.e. images that do
not have a linear relationship to well known Coordinate Reference System
like (latitude, longitude), but are instead defined by a collection of
anchor points). This work is happening in the "ImageDatum" branch and
would also be a candidate for merging after the SIS release.
Is there any comments?
Martin
Le 11/04/16 10:30, johann sorel a écrit :
> Hello,
>
> GPX reader and writer for version 1.0 and 1.1 are available.
> Those are low level classes since we don't have yet anything like
> feature collections or appropriate store api for features.
>
> Here are short code examples :
> I don't know where we should put those code snippet, maybe in the FAQ ?
>
> //reading
> try (final GPXReader reader = new GPXReader()) {
> reader.setInput(fileOrElse);
> final MetaData data = reader.getMetadata();
> final GPXVersion version = reader.getVersion();
> while (reader.hasNext()) {
> final Feature feature = reader.next();
> //...
> }
> }
>
> //writing
> try (GPXWriter110 writer = new GPXWriter110("producer name")) {
> writer.setOutput(fileOrElse);
> writer.writeStartDocument();
> writer.writeGPXTag();
>
> for(int i=0;i<100;i++){
> final Feature route = GPXConstants.TYPE_ROUTE.newInstance();
> route.setPropertyValue("...", "...");
> //...
> writer.writeRoute(route);
> }
> writer.writeEndDocument();
> }
>
> Johann