Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Coordinate


 
  private void createDummyPointMarker() throws Exception{
    // create some dummy data
    m1.setMarkerIconId(0);
    m1.setNotes("marker1");
    m1.setPoint(factory.createPoint(new Coordinate(10,10)));
    int id = geomMarkerDao.createPointMarker(m1);
    m1.setId(id);
   
    m2.setMarkerIconId(0);
    m2.setNotes("marker2");
    m2.setPoint(factory.createPoint(new Coordinate(20,20)));
    id = geomMarkerDao.createPointMarker(m2);
    m2.setId(id)
  }
View Full Code Here


 
  public void testUpdatePointMarker() throws Exception{
    PointMarker pm = geomMarkerDao.getPointMarker(m1.getId());
    pm.setMarkerIconId(10);
    pm.setNotes("newnotes");
    Point p3 = factory.createPoint(new Coordinate(30,30));
    pm.setPoint(p3);
    assertTrue(geomMarkerDao.updatePointMarker(pm));
    pm = geomMarkerDao.getPointMarker(m1.getId());
    assertEquals(m1.getId(),pm.getId());
    assertEquals(10,pm.getMarkerIconId());
View Full Code Here

   * @param x the X-value of a point
   * @param y the Y-value of a point
   */
  public void setPoint(double x, double y){
    if(geometry == null){
      geometry = geometryFactory.createPoint(new Coordinate(x,y));
    }else{
      geometry.getCoordinate().x = x;
      geometry.getCoordinate().y = y;
      geometry.geometryChanged();
    }
View Full Code Here

   * Sets the X-value of this point marker
   * @param x the X-value to set
   */
  public void setX(double x){
    if(geometry == null){
      geometry = geometryFactory.createPoint(new Coordinate(x,0));
    }else{
      geometry.getCoordinate().x = x;
      geometry.geometryChanged();
    }
  }
View Full Code Here

   * Sets the Y-value of this point marker
   * @param y the Y-value to set
   */
  public void setY(double y){
    if(geometry == null){
      geometry = geometryFactory.createPoint(new Coordinate(0,y));
    }else{
      geometry.getCoordinate().y = y;
      geometry.geometryChanged();
    }
  }
View Full Code Here

    if(pv != null){
      String[] pt = pv.split(",");
      if(pt != null && pt.length == 2){
        double lon = Double.parseDouble(pt[0]);
        double lat = Double.parseDouble(pt[1]);
        return factory.createPoint(new Coordinate(lon,lat));
      }
    }
    return null;
  }
View Full Code Here

    // up to shapetype
    document.closeElement();

    for (InternalFeature f : tile.getFeatures()) {
      InternalFeatureImpl feature = (InternalFeatureImpl) f;
      Coordinate pos = geoService.calcDefaultLabelPosition(feature);
      if (pos == null) {
        continue;
      }
      com.vividsolutions.jts.geom.Point p = factory.createPoint(pos);
      com.vividsolutions.jts.geom.Point labelPos;
View Full Code Here

  }

  private Geometry getLineString() {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    return factory.createLineString(new Coordinate[] {
        new Coordinate(5, 4), new Coordinate(30, 10), new Coordinate(120, 150), new Coordinate(50, 50)});
  }
View Full Code Here

  @Test
  public void transformOutsideAreaTest() throws Exception {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    Geometry geometry = factory.createLineString(new Coordinate[] {
        new Coordinate(110, 50), new Coordinate(120, 60)});
    geometry = geoService.transform(geometry, LONLAT, LAMBERT72);
    Assert.assertTrue(geometry.isEmpty());
  }
View Full Code Here

  public void writePathContent(Coordinate[] coords, char path, char point) throws RenderException {
    try {
      checkState(true);
      writer.write(path);

      Coordinate curr = roundCoordinate(coords[0]);
      writeCoordinate(curr);
      Coordinate prev = curr;

      int nCoords = coords.length;
      if (nCoords > 1) {
        writer.write(point);
        for (int i = 1; i < nCoords; i++) {
          curr = coords[i];
          Coordinate delta = new Coordinate(curr.x - prev.x, curr.y - prev.y);
          delta = roundCoordinate(delta);
          if (!delta.equals(NULL_COORDINATE) || i == 1) {
            writeCoordinate(delta);
            prev.x += delta.x;
            prev.y += delta.y;
            writer.write(' ');
          }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.Coordinate

Copyright © 2018 www.massapicom. 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.