Class FeaturesParser


  • public class FeaturesParser
    extends java.lang.Object
    Parser for GeoJson features collection.

    Created by Stéphane Brunner on 16/4/14.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.geotools.data.simple.SimpleFeatureCollection autoTreat​(Template template, java.lang.String features)
      Get the features collection from a GeoJson inline string or URL.
      org.geotools.data.simple.SimpleFeatureCollection treatStringAsGeoJson​(java.lang.String geoJsonString)
      Get the features collection from a GeoJson inline string.
      org.geotools.data.simple.SimpleFeatureCollection treatStringAsURL​(Template template, java.lang.String geoJsonUrl)
      Get the features collection from a GeoJson URL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FeaturesParser

        public FeaturesParser​(MfClientHttpRequestFactory httpRequestFactory,
                              boolean forceLongitudeFirst)
        Construct.
        Parameters:
        httpRequestFactory - the HTTP request factory
        forceLongitudeFirst - if true then force longitude coordinate as first coordinate
    • Method Detail

      • autoTreat

        public final org.geotools.data.simple.SimpleFeatureCollection autoTreat​(Template template,
                                                                                java.lang.String features)
                                                                         throws java.io.IOException
        Get the features collection from a GeoJson inline string or URL.
        Parameters:
        template - the template
        features - what to parse
        Returns:
        the feature collection
        Throws:
        java.io.IOException
      • treatStringAsURL

        public final org.geotools.data.simple.SimpleFeatureCollection treatStringAsURL​(Template template,
                                                                                       java.lang.String geoJsonUrl)
                                                                                throws java.io.IOException
        Get the features collection from a GeoJson URL.
        Parameters:
        template - the template
        geoJsonUrl - what to parse
        Returns:
        the feature collection
        Throws:
        java.io.IOException
      • treatStringAsGeoJson

        public final org.geotools.data.simple.SimpleFeatureCollection treatStringAsGeoJson​(java.lang.String geoJsonString)
                                                                                    throws java.io.IOException
        Get the features collection from a GeoJson inline string.
        Parameters:
        geoJsonString - what to parse
        Returns:
        the feature collection
        Throws:
        java.io.IOException