Package dev.avelar.mapnik
Class Feature
java.lang.Object
dev.avelar.mapnik.Feature
One feature: an id, named attributes and a geometry. A feature is a plain snapshot. It holds no
native memory, so there is nothing to close and it stays valid after the
Featureset that
produced it is closed. Features come out of queries, or you build them with create(long, dev.avelar.mapnik.Geometry, java.util.Map<java.lang.String, ?>) and
add them to a MemoryDatasource.-
Method Summary
Modifier and TypeMethodDescriptionOne attribute, or null if it is missing or null.Attributes by name, in name order.static Featurestatic FeatureBuild a feature.envelope()Bounding box of the geometry, in the datasource's projection.static FeaturefromGeoJson(String json) AsfromGeoJson(String, long), with id 1 if the feature has none.static FeaturefromGeoJson(String json, long defaultId) Read a GeoJSON Feature.geometry()The geometry as an object you can inspect, reproject and so on.The geometry as a GeoJSON geometry object.GeometryKind.UNKNOWNif the feature has no geometry.The geometry as WKT, for examplePOINT(1 2).longid()listFromGeoJson(String json) Read every feature of a GeoJSON FeatureCollection, or the single feature of a Feature.reproject(CoordinateTransform transform) A copy of this feature with its geometry reprojected.The whole feature as a GeoJSON Feature.toString()
-
Method Details
-
create
-
create
-
reproject
A copy of this feature with its geometry reprojected. The id and attributes are unchanged. -
fromGeoJson
-
fromGeoJson
AsfromGeoJson(String, long), with id 1 if the feature has none. -
listFromGeoJson
Read every feature of a GeoJSON FeatureCollection, or the single feature of a Feature. Features without a whole-numberidare numbered from 1 by their position. -
id
public long id() -
attributes
-
attribute
One attribute, or null if it is missing or null. -
geometryKind
GeometryKind.UNKNOWNif the feature has no geometry. -
envelope
Bounding box of the geometry, in the datasource's projection. Null for an empty geometry. -
geometry
The geometry as an object you can inspect, reproject and so on. Empty if the feature has none. -
geometryWkt
The geometry as WKT, for examplePOINT(1 2). Mapnik normalises polygon ring orientation. -
geometryGeoJson
The geometry as a GeoJSON geometry object. The textnullfor an empty geometry. -
toGeoJson
The whole feature as a GeoJSON Feature. -
toString
-