org.locationtech.jts.geom.Polygon.getSRID()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.locationtech.jts.geom.Polygon.getSRID()方法的一些代码示例,展示了Polygon.getSRID()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Polygon.getSRID()方法的具体详情如下:
包路径:org.locationtech.jts.geom.Polygon
类名称:Polygon
方法名:getSRID

Polygon.getSRID介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

public int getSRID() {
  return polygon.getSRID();
}

代码示例来源:origin: locationtech/jts

public Object parse(Handler arg, GeometryFactory gf) throws SAXException {
    // one child, either a coord
    // or a coordinate sequence
    
    if(arg.children.size()<1)
      throw new SAXException("Cannot create a polygon without atleast one linear ring");
    int srid = getSrid(arg.attrs,gf.getSRID());
    
    LinearRing outer = (LinearRing) arg.children.get(0); // will be the first
    List t = arg.children.size()>1?arg.children.subList(1,arg.children.size()):null;
    LinearRing[] inner = t==null?null:(LinearRing[]) t.toArray(new LinearRing[t.size()]);
    
    Polygon p = gf.createPolygon(outer,inner);
    
    if(p.getSRID()!=srid)
      p.setSRID(srid);
    
    return p;
  }
});

代码示例来源:origin: geoserver/geofence

/**
 * Creates the polygon.
 *
 * @param wkt
 *            the wkt
 * @return the polygon
 * @throws ParseException
 *             the parse exception
 */
public Polygon createPolygon(String wkt) throws ParseException
{
  Polygon poly = polAdapter.unmarshal(wkt);
  if (poly.getSRID() == 0)
  {
    poly.setSRID(4326);
  }
  return poly;
}

代码示例来源:origin: org.geoserver.geofence/geofence-model-internal

@Override
  public String marshal(Polygon the_geom) throws ParseException {
    if (the_geom != null) {
      WKTWriter wktWriter = new WKTWriter();
      if (the_geom.getSRID() == 0)
        the_geom.setSRID(4326);

      return wktWriter.write(the_geom);
    } else {
      throw new ParseException("Polygon obj is null.");
    }
  }
}

代码示例来源:origin: org.geoserver.geofence/geofence-model

@Override
  public String marshal(Polygon the_geom) throws ParseException {
    if (the_geom != null) {
      WKTWriter wktWriter = new WKTWriter();
      if (the_geom.getSRID() == 0)
        the_geom.setSRID(4326);

      return wktWriter.write(the_geom);
    } else {
      throw new ParseException("Polygon obj is null.");
    }
  }
}

代码示例来源:origin: geoserver/geofence

@Override
  public String marshal(Polygon the_geom) throws ParseException {
    if (the_geom != null) {
      WKTWriter wktWriter = new WKTWriter();
      if (the_geom.getSRID() == 0)
        the_geom.setSRID(4326);

      return wktWriter.write(the_geom);
    } else {
      throw new ParseException("Polygon obj is null.");
    }
  }
}

代码示例来源:origin: geoserver/geofence

@Override
  public String marshal(Polygon the_geom) throws ParseException {
    if (the_geom != null) {
      WKTWriter wktWriter = new WKTWriter();
      if (the_geom.getSRID() == 0)
        the_geom.setSRID(4326);

      return wktWriter.write(the_geom);
    } else {
      throw new ParseException("Polygon obj is null.");
    }
  }
}

代码示例来源:origin: Geomatys/geotoolkit

@Override
public MultiPolygon apply(Polygon object) throws UnconvertibleObjectException {
  final MultiPolygon geom = object.getFactory().createMultiPolygon(new Polygon[]{object});
  geom.setSRID(object.getSRID());
  geom.setUserData(object.getUserData());
  return geom;
}

相关文章