Examples of Coordinate


Examples of com.vividsolutions.jts.geom.Coordinate

   * @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

Examples of com.vividsolutions.jts.geom.Coordinate

   * 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

Examples of com.vividsolutions.jts.geom.Coordinate

   * 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

Examples of com.vividsolutions.jts.geom.Coordinate

    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

Examples of com.vividsolutions.jts.geom.Coordinate

    // 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

Examples of com.vividsolutions.jts.geom.Coordinate

  }

  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

Examples of com.vividsolutions.jts.geom.Coordinate

  @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

Examples of com.vividsolutions.jts.geom.Coordinate

  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

Examples of com.vividsolutions.jts.geom.Coordinate

  public void registerWriter(Class<?> c, GraphicsWriter writerToRegister) {
    writers.put(c, writerToRegister);
  }

  protected Coordinate roundCoordinate(Coordinate c) throws RenderException {
    return new Coordinate(roundDouble(c.x), roundDouble(c.y));
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.Coordinate

    }
    GetLocationResult result = new GetLocationResult();
    if (null != test.getBbox()) {
      result.setEnvelope(dtoConverterService.toInternal(test.getBbox()));
    } else {
      result.setCoordinate(new Coordinate(test.getX(), test.getY()));
    }
    result.setCanonicalStrings(test.getCanonical());
    result.setUserData(test.getUserData());
    return result;
  }
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.