MATSIM
ShapeFileReader.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * ShapeFileReader.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2008 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.utils.gis;
22 
23 import org.geotools.api.data.DataStore;
24 import org.geotools.api.data.FileDataStore;
25 import org.geotools.api.data.SimpleFeatureSource;
26 import org.geotools.api.feature.simple.SimpleFeature;
27 import org.geotools.api.feature.simple.SimpleFeatureType;
28 import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
29 import org.geotools.data.simple.SimpleFeatureCollection;
30 import org.geotools.geometry.jts.ReferencedEnvelope;
32 
33 import java.io.IOException;
34 import java.io.UncheckedIOException;
35 import java.net.URL;
36 import java.util.Collection;
37 import java.util.List;
38 
44 @Deprecated
45 public class ShapeFileReader implements MatsimSomeReader {
46 
47  private final GeoFileReader geoFileReader = new GeoFileReader();
48 
49  public static Collection<SimpleFeature> getAllFeatures(final String filename) {
50  return GeoFileReader.getAllFeatures(filename, null);
51  }
52 
53  public static Collection<SimpleFeature> getAllFeatures(final URL url) {
54  return GeoFileReader.getAllFeatures(url);
55  }
56 
61  public static List<SimpleFeature> getSimpleFeatures(FileDataStore dataStore) throws IOException {
62  return GeoFileReader.getSimpleFeatures(dataStore);
63  }
64 
68  public Collection<SimpleFeature> readFileAndInitialize(final String filename) throws UncheckedIOException {
69  return geoFileReader.readFileAndInitialize(filename);
70  }
71 
109  public static SimpleFeatureSource readDataFile(final String filename) throws UncheckedIOException {
110  return GeoFileReader.readDataFile(filename);
111  }
112 
113  public SimpleFeatureSource getFeatureSource() {
114  return geoFileReader.getFeatureSource();
115  }
116 
117  public ReferencedEnvelope getBounds() {
118  return geoFileReader.getBounds();
119  }
120 
121  public DataStore getDataStore() {
122  return geoFileReader.getDataStore();
123  }
124 
125  public SimpleFeatureCollection getFeatureCollection() {
126  return geoFileReader.getFeatureCollection();
127  }
128 
129  public SimpleFeatureType getSchema() {
130  return geoFileReader.getSchema();
131  }
132 
133  public Collection<SimpleFeature> getFeatureSet() {
134  return geoFileReader.getFeatureSet();
135  }
136 
137  public CoordinateReferenceSystem getCoordinateSystem(){
138  return geoFileReader.getCoordinateSystem();
139  }
140 
141 
142 }
SimpleFeatureCollection getFeatureCollection()
Collection< SimpleFeature > getFeatureSet()
static List< SimpleFeature > getSimpleFeatures(FileDataStore dataStore)
SimpleFeatureCollection getFeatureCollection()
static Collection< SimpleFeature > getAllFeatures(final URL url)
Collection< SimpleFeature > getFeatureSet()
static SimpleFeatureSource readDataFile(final String filename)
static Collection< SimpleFeature > getAllFeatures(final String filename)
Collection< SimpleFeature > readFileAndInitialize(final String filename)
static List< SimpleFeature > getSimpleFeatures(FileDataStore dataStore)
static SimpleFeatureSource readDataFile(final String filename)
static Collection< SimpleFeature > getAllFeatures(final String filename)
CoordinateReferenceSystem getCoordinateSystem()
CoordinateReferenceSystem getCoordinateSystem()
Collection< SimpleFeature > readFileAndInitialize(final String filename)