Create a Geometry from a GeoServiceGeometry.

@param featureCollection the feature collection representing the geometry
@return the Geometry
17241
public Geometry toGeometry(final FeatureCollection featureCollection) {
        if (featureCollection == null) {
            return null;
        }
        final Geometry geometry = new Geometry();
        final Feature location =
                populateBoundaries(geometry, featureCollection);
        populateLocation(geometry, location);
        return geometry;
    }
491179
public JTSGeometryExpression<Geometry> union(Expression<? extends Geometry> geometry) {
        return JTSGeometryExpressions.geometryOperation(SpatialOps.UNION, mixin, geometry);
    }
1196002
private LinkedHashMap<Integer, Coordinate> getCoordinate( int nStaz, SimpleFeatureCollection collection, String idField )
            throws Exception {
        LinkedHashMap<Integer, Coordinate> id2CoordinatesMap = new LinkedHashMap<Integer, Coordinate>();
        FeatureIterator<SimpleFeature> iterator = collection.features();
        Coordinate coordinate = null;
        try {
            while( iterator.hasNext() ) {
                SimpleFeature feature = iterator.next();
                int name = ((Number) feature.getAttribute(idField)).intValue();
                coordinate = ((Geometry) feature.getDefaultGeometry()).getCentroid().getCoordinate();
                double z = 0;
                if (fPointZ != null) {
                    try {
                        z = ((Number) feature.getAttribute(fPointZ)).doubleValue();
                    } catch (NullPointerException e) {
                        pm.errorMessage(msg.message("kriging.noPointZ"));
                        throw new Exception(msg.message("kriging.noPointZ"));
                    }
                }
                coordinate.z = z;
                id2CoordinatesMap.put(name, coordinate);
            }
        } finally {
            iterator.close();
        }

        return id2CoordinatesMap;
    }
1251385
private function writeFeatureCollection(GeometryCollection $geometryCollection) : string
    {
        $geojsonArray = [
            'type' => 'FeatureCollection',
            'features' => []
        ];

        foreach ($geometryCollection->geometries() as $geometry) {
            $geojsonArray['features'][] = [
                'type' => 'Feature',
                'geometry' => $this->formatGeoJSONGeometry($geometry)
            ];
        }

        return $this->genGeoJSONString($geojsonArray);
    }
78674
function(collection) {
            var array = [];
            for(var i=0, len=collection.components.length; i<len; ++i) {
                array.push(this.extractGeometry.apply(this, [collection.components[i]]));
            }
            return array.join(',');
        }
645857
public void addGeometry(Geometry geometry) {
    if (geometry instanceof LineString) {
      addLineString(originalSegments, (LineString) geometry);
    } else if (geometry instanceof Polygon) {
      addPolygon(originalSegments, (Polygon) geometry);
    } else if (geometry instanceof GeometryCollection) {
      addGeometry(originalSegments, (GeometryCollection) geometry);
    }
  }
440388
public CloseableIterator<GeometryIndex> query(BoundingBox boundingBox,
			Projection projection) {

		BoundingBox featureBoundingBox = getFeatureBoundingBox(boundingBox,
				projection);

		CloseableIterator<GeometryIndex> geometryIndices = query(featureBoundingBox);

		return geometryIndices;
	}
168733
public static TypeAdapterFactory create() {

    if (geometryTypeFactory == null) {
      geometryTypeFactory = RuntimeTypeAdapterFactory.of(Geometry.class, "type", true)
        .registerSubtype(GeometryCollection.class, "GeometryCollection")
        .registerSubtype(Point.class, "Point")
        .registerSubtype(MultiPoint.class, "MultiPoint")
        .registerSubtype(LineString.class, "LineString")
        .registerSubtype(MultiLineString.class, "MultiLineString")
        .registerSubtype(Polygon.class, "Polygon")
         .registerSubtype(MultiPolygon.class, "MultiPolygon");
    }
    return geometryTypeFactory;
  }
661093
@Api
	public void panToFeatures(List<Feature> features) {
		PanToFeaturesLazyLoadCallback callback = new PanToFeaturesLazyLoadCallback(features.size());
		for (Feature feature : features) {
			// no need to fetch if we already have the geometry !
			if (feature.isGeometryLoaded()) {
				callback.execute(Arrays.asList(feature));
			} else {
				feature.getLayer().getFeatureStore()
						.getFeature(feature.getId(), GeomajasConstant.FEATURE_INCLUDE_GEOMETRY, callback);			
			}
		}
	}
1308512
public ServiceCall<Collection> createCollection(CreateCollectionOptions createCollectionOptions) {
    Validator.notNull(createCollectionOptions, "createCollectionOptions cannot be null");
    String[] pathSegments = { "v1/environments", "collections" };
    String[] pathParameters = { createCollectionOptions.environmentId() };
    RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
        pathParameters));
    builder.query("version", versionDate);
    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "createCollection");
    for (Entry<String, String> header : sdkHeaders.entrySet()) {
      builder.header(header.getKey(), header.getValue());
    }
    builder.header("Accept", "application/json");
    final JsonObject contentJson = new JsonObject();
    contentJson.addProperty("name", createCollectionOptions.name());
    if (createCollectionOptions.description() != null) {
      contentJson.addProperty("description", createCollectionOptions.description());
    }
    if (createCollectionOptions.configurationId() != null) {
      contentJson.addProperty("configuration_id", createCollectionOptions.configurationId());
    }
    if (createCollectionOptions.language() != null) {
      contentJson.addProperty("language", createCollectionOptions.language());
    }
    builder.bodyJson(contentJson);
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Collection.class));
  }
163783
public static List<SimpleFeature> featureCollectionToList( SimpleFeatureCollection collection ) {
        List<SimpleFeature> featuresList = new ArrayList<SimpleFeature>();
        if (collection == null) {
            return featuresList;
        }
        SimpleFeatureIterator featureIterator = collection.features();
        while( featureIterator.hasNext() ) {
            SimpleFeature feature = featureIterator.next();
            featuresList.add(feature);
        }
        featureIterator.close();
        return featuresList;
    }
503147
public Geometry createGeometry(Geometry geometry) {
		if (geometry instanceof Point) {
			return createPoint(geometry.getCoordinate());
		} else if (geometry instanceof LinearRing) {
			return createLinearRing(geometry.getCoordinates());
		} else if (geometry instanceof LineString) {
			return createLineString(geometry.getCoordinates());
		} else if (geometry instanceof Polygon) {
			Polygon polygon = (Polygon) geometry;
			LinearRing exteriorRing = createLinearRing(polygon.getExteriorRing().getCoordinates());
			LinearRing[] interiorRings = new LinearRing[polygon.getNumInteriorRing()];
			for (int n = 0; n < polygon.getNumInteriorRing(); n++) {
				interiorRings[n] = createLinearRing(polygon.getInteriorRingN(n).getCoordinates());
			}
			return new Polygon(srid, precision, exteriorRing, interiorRings);
		} else if (geometry instanceof MultiPoint) {
			Point[] clones = new Point[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = createPoint(geometry.getGeometryN(n).getCoordinate());
			}
			return new MultiPoint(srid, precision, clones);
		} else if (geometry instanceof MultiLineString) {
			LineString[] clones = new LineString[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = createLineString(geometry.getGeometryN(n).getCoordinates());
			}
			return new MultiLineString(srid, precision, clones);
		} else if (geometry instanceof MultiPolygon) {
			Polygon[] clones = new Polygon[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = (Polygon) createGeometry(geometry.getGeometryN(n));
			}
			return new MultiPolygon(srid, precision, clones);
		}
		return null;
	}
776638
function(feature) {
        return this.geometryTypes == null ||
            OpenLayers.Util.indexOf(this.geometryTypes,
                                    feature.geometry.CLASS_NAME) > -1;
    }
30773
public Geometry toGeometry(String wkt) {
		try {
			return WktService.toGeometry(wkt);
		} catch (WktException e) {
			return null;
		}
	}
578719
public static String toGeojson(Geometry geom) {
        StringBuilder sb = new StringBuilder();
        toGeojsonGeometry(geom, sb);
        return sb.toString();
    }
140104
private static void getPunctualGeometry(ArrayList<Point> points, Geometry geometry) {
         for (int i = 0; i < geometry.getNumGeometries(); i++) {
            Geometry subGeom = geometry.getGeometryN(i);
            if(subGeom instanceof Point){
                points.add((Point) subGeom);
            }
            else if (subGeom instanceof GeometryCollection){
                getPunctualGeometry(points, subGeom);
            }
        }
    }
1124962
public static void toGeojsonGeometry(Geometry geom, StringBuilder sb) {
        if (geom instanceof Point) {
            toGeojsonPoint((Point) geom, sb);
        } else if (geom instanceof LineString) {
            toGeojsonLineString((LineString) geom, sb);
        } else if (geom instanceof Polygon) {
            toGeojsonPolygon((Polygon) geom, sb);
        } else if (geom instanceof MultiPoint) {
            toGeojsonMultiPoint((MultiPoint) geom, sb);
        } else if (geom instanceof MultiLineString) {
            toGeojsonMultiLineString((MultiLineString) geom, sb);
        } else if (geom instanceof MultiPolygon) {
            toGeojsonMultiPolygon((MultiPolygon) geom, sb);
        } else {
            toGeojsonGeometryCollection((GeometryCollection) geom, sb);
        }
    }