Codota Logo
PolygonFeatureFactory$Builder.setName
Code IndexAdd Codota to your IDE (free)

How to use
setName
method
in
org.matsim.core.utils.gis.PolygonFeatureFactory$Builder

Best Java code snippets using org.matsim.core.utils.gis.PolygonFeatureFactory$Builder.setName (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: matsim-org/matsim

  public void write(String shpFile) {
    CoordinateReferenceSystem crs = MGC.getCRS(coordinateSystem);

    PolygonFeatureFactory factory = new PolygonFeatureFactory.Builder().addAttribute(ID_HEADER, String.class)
        .setCrs(crs).setName("zone").create();

    List<SimpleFeature> features = new ArrayList<>();
    for (Zone z : zones.values()) {
      String id = z.getId() + "";
      features.add(factory.createPolygon(z.getMultiPolygon(), new Object[] { id }, id));
    }

    ShapeFileWriter.writeGeometries(features, shpFile);
  }
}
origin: matsim-org/matsim

@Test
public void testShapeFileWriterWithSelfCreatedContent_withMatsimFactory_Polygon() throws IOException {
  String outFile = utils.getOutputDirectory() + "test.shp";
  
  PolygonFeatureFactory ff = new PolygonFeatureFactory.Builder()
      .setName("EvacuationArea")
      .setCrs(DefaultGeographicCRS.WGS84)
      .addAttribute("name", String.class)
      .create();
  
  Coordinate[] coordinates = new Coordinate[]{new Coordinate(0,0),new Coordinate(0,1),new Coordinate(1,1),new Coordinate(0,0)};
  SimpleFeature f = ff.createPolygon(coordinates);
  
  Collection<SimpleFeature> features = new ArrayList<SimpleFeature>();
  features.add(f);
  
  Geometry g0 = (Geometry) f.getDefaultGeometry();
  
  ShapeFileWriter.writeGeometries(features, outFile);
  
  SimpleFeatureSource s1 = ShapeFileReader.readDataFile(outFile);
  SimpleFeatureCollection fts1 = s1.getFeatures();
  SimpleFeatureIterator it1 = fts1.features();
  SimpleFeature ft1 = it1.next();
  Geometry g1 = (Geometry) ft1.getDefaultGeometry();
  
  Assert.assertEquals(g0.getCoordinates().length, g1.getCoordinates().length);
}
origin: matsim-org/matsim

private void initLandUseFeatureType(String landUseType) {
  
  // TODO make CRS adjustable
  
  this.polygonFeatureFactory = new PolygonFeatureFactory.Builder().
  setCrs(MGC.getCRS(TransformationFactory.DHDN_GK4)).
  //setName("buildings").
  setName("land_use").
  addAttribute(landUseType, String.class).
  create();
}    

org.matsim.core.utils.gisPolygonFeatureFactory$BuildersetName

Popular methods of PolygonFeatureFactory$Builder

  • <init>
  • addAttribute
  • create
  • setCrs

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now