Package com.bedatadriven.geojson

Examples of com.bedatadriven.geojson.GeometrySerializer


   */
  private void writeFeature(int i, JsonGenerator jgen, Boolean forcePoints) throws IOException {

    GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel());

    GeometrySerializer geomSerializer = new GeometrySerializer();

    jgen.writeStartObject();
    {
      jgen.writeStringField("id", ids[i]);
      jgen.writeStringField("type", "Feature");
      jgen.writeFieldName("geometry");
      {

        if (!forcePoints && polygons != null && polygons.length >= i && polygons[i] != null) {
          geomSerializer.writeGeometry(jgen, polygons[i]);
        } else {

          Point p = geometryFactory.createPoint(new Coordinate(lons[i], lats[i]));
          geomSerializer.writeGeometry(jgen, p);
        }

      }
      jgen.writeObjectFieldStart("properties");
      {
View Full Code Here

TOP

Related Classes of com.bedatadriven.geojson.GeometrySerializer

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.