Examples of PointFeature


Examples of de.fhpotsdam.unfolding.data.PointFeature

   * @return A list of locations.
   */
  public static List<Location> getLocations(Feature feature) {
    List<Location> locations = new ArrayList<Location>();
    if (feature.getType() == Feature.FeatureType.POINT) {
      PointFeature pf = (PointFeature) feature;
      locations.add(pf.getLocation());
    }
    if (feature.getType() == Feature.FeatureType.LINES || feature.getType() == Feature.FeatureType.POLYGON) {
      ShapeFeature sf = (ShapeFeature) feature;
      locations.addAll(sf.getLocations());
    }
View Full Code Here

Examples of de.fhpotsdam.unfolding.data.PointFeature

  public List<Marker> createLabeledMarkers(List<Feature> features) {
    PFont font = loadFont("ui/OpenSans-12.vlw");
    List<Marker> markers = new ArrayList<Marker>();
    for (Feature feature : features) {
      String label = feature.getStringProperty("title");
      PointFeature pointFeature = (PointFeature) feature;
      Marker marker = new LabeledMarker(pointFeature.getLocation(), label, font, 15);
      markers.add(marker);
    }
    return markers;
  }
View Full Code Here

Examples of de.fhpotsdam.unfolding.data.PointFeature

   
    fill(255, 0, 0, 100);
    noStroke();
    float maxSize = map(map.getZoomLevel(), 0, 6, 4, 40);
    for (Feature feature : features) {
      PointFeature pf = (PointFeature) feature;
      ScreenPosition pos = map.getScreenPosition(pf.getLocation());
      pushMatrix();
      translate(pos.x, pos.y);
      float magnitude = (Float) feature.getProperty("magnitude");
      if (useColorCoding) {
        int color = mapToColor(magnitude);
View Full Code Here

Examples of de.fhpotsdam.unfolding.data.PointFeature

   
    fill(255, 0, 0, 100);
    noStroke();
    float maxSize = map(map.getZoomLevel(), 0, 6, 4, 40);
    for (Feature feature : features) {
      PointFeature pf = (PointFeature) feature;
      ScreenPosition pos = map.getScreenPosition(pf.getLocation());
      float magnitude = (Float) feature.getProperty("magnitude");
      float s = map(magnitude, 4, 8, 4, maxSize);
      beginShape(QUAD);
      vertex(pos.x, pos.y, 5);
      vertex(pos.x + s, pos.y, 5);
View Full Code Here

Examples of org.opentripplanner.analyst.PointFeature

    }
   
    public void testLoadShapefile() throws NoSuchAuthorityCodeException, IOException, FactoryException, EmptyPolygonException, UnsupportedGeometryException {
        PointSet points = PointSet.fromShapefile(new File("src/test/resources/pointset/shp/austin.shp"));
        assertNotNull(points);
        PointFeature ft = points.getFeature(0);
        int pop = ft.getProperty("DEC_10_S_2");
        assertEquals( pop, 42 );
    }
View Full Code Here

Examples of org.opentripplanner.analyst.PointFeature

        assertEquals( pop, 42 );
    }
   
    public void testGetFeature() {
        PointSet points = PointSet.fromGeoJson(new File("src/test/resources/pointset/population.geo.json"));
        PointFeature pt = points.getFeature(0);
       
        assertNotNull(pt);
        assertEquals( pt.getId(), "XYZ0001");
        Map<String,Integer> attrs = pt.getProperties();
        assertEquals( attrs.size(), 6 );
        assertEquals( pt.getProperty( "age:child" ), 10 );
    }
View Full Code Here

Examples of ucar.nc2.ft.PointFeature

  }

  private PointFeature nextFilteredDataPoint() throws IOException {
    if (pfiter == null) return null;
    if (!pfiter.hasNext()) return null;
    PointFeature pdata = pfiter.next();

    if (filter == null)
      return pdata;

    while (!filter.filter(pdata)) {
View Full Code Here

Examples of ucar.nc2.ft.PointFeature

  private PointFeature nextFilteredDataPoint() throws IOException {
    if ( orgIter == null) return null;
    if (!orgIter.hasNext()) return null;

    PointFeature pdata = orgIter.next();
    while (!filter(pdata)) {
      if (!orgIter.hasNext()) return null;
      pdata = orgIter.next();
    }
View Full Code Here

Examples of ucar.nc2.ft.PointFeature

    }

    int count = 0;
    pointFeatureCollection.resetIteration();
    while (pointFeatureCollection.hasNext()) {
      PointFeature pointFeature = (PointFeature) pointFeatureCollection.next();
      StructureData data = pointFeature.getData();
      if (count == 0) {
        EarthLocation loc = pointFeature.getLocation(); // LOOK we dont know this until we see the obs
        String altUnits = Double.isNaN(loc.getAltitude()) ? null : "meters"; // LOOK units may be wrong
        writer = new WriterCFPointDataset(out, pfDataset.getGlobalAttributes(), altUnits);
        writer.writeHeader( dataVars, -1);
      }
      writer.writeRecord(pointFeature, data);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.