20 package org.matsim.utils.gis.matsim2esri.network;
22 import java.util.ArrayList;
23 import java.util.Collection;
25 import org.apache.logging.log4j.LogManager;
26 import org.apache.logging.log4j.Logger;
27 import org.geotools.api.feature.simple.SimpleFeature;
28 import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
29 import org.geotools.feature.simple.SimpleFeatureBuilder;
30 import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
31 import org.locationtech.jts.geom.Point;
71 Collection<SimpleFeature> features =
new ArrayList<SimpleFeature>();
82 return this.builder.buildFeature(null,
new Object[]{p,node.
getId().toString()});
83 }
catch (IllegalArgumentException e) {
89 SimpleFeatureTypeBuilder typeBuilder =
new SimpleFeatureTypeBuilder();
90 typeBuilder.setName(
"node");
91 typeBuilder.setCRS(crs);
92 typeBuilder.add(
"location", Point.class);
93 typeBuilder.add(
"ID", String.class);
95 this.builder =
new SimpleFeatureBuilder(typeBuilder.buildFeatureType());
98 public static void main(String [] args) {
99 String netfile = null ;
100 String outputFile = null ;
102 if ( args.length == 0 ) {
103 netfile =
"./examples/equil/network.xml";
106 outputFile =
"./plans/networkNodes.shp";
107 }
else if ( args.length == 2 ) {
109 outputFile = args[1] ;
111 log.error(
"Arguments cannot be interpreted. Aborting ...") ;
118 log.info(
"loading network from " + netfile);
static Node [] getSortedNodes(final Network network)
void initFeatureType(final CoordinateReferenceSystem crs)
Nodes2ESRIShape(Network network, String filename, CoordinateReferenceSystem crs)
SimpleFeature getFeature(Node node)
static void writeGeometries(final Collection< SimpleFeature > features, final String filename)
static void main(String [] args)
Nodes2ESRIShape(final Network network, final String filename, final String coordinateSystem)
final Network getNetwork()
SimpleFeatureBuilder builder
static Scenario createScenario(final Config config)
static Config createConfig(final String context)