public final SimpleFeatureCollection treatStringAsURL ( final Template template , final String geoJsonUrl ) throws IOException { URL url ; try { url = FileUtils . testForLegalFileUrl ( template . getConfiguration ( ) , new URL ( geoJsonUrl ) ) ; } catch ( MalformedURLException e ) { return null ; } final String geojsonString ; if ( url . getProtocol ( ) . equalsIgnoreCase ( "file" ) ) { geojsonString = IOUtils . toString ( url , Constants . DEFAULT_CHARSET . name ( ) ) ; } else { geojsonString = URIUtils . toString ( this . httpRequestFactory , url ) ; } return treatStringAsGeoJson ( geojsonString ) ; }
Get the features collection from a GeoJson URL .