Package org.h2gis.functions.io.geojson
Class GeoJsonWriteDriver
java.lang.Object
org.h2gis.functions.io.geojson.GeoJsonWriteDriver
A simple GeoJSON driver to write a spatial table to a GeoJSON file.
GeoJSON is a format for encoding a variety of geographic data structures. A
GeoJSON object may represent a geometry, a feature, or a collection of
features. GeoJSON supports the following geometry types: POINT, LINESTRING,
POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION.
Syntax:
{ "type": "FeatureCollection", "features": [ { "type": "Feature",
"geometry":{"type": "Point", "coordinates": [102.0, 0.5]}, "properties":
{"prop0": "value0"} } ]}
- Author:
- Erwan Bocher, Hai Trung Pham
-
Constructor Summary
ConstructorsConstructorDescriptionGeoJsonWriteDriver(Connection connection) A simple GeoJSON driver to write a spatial table to a GeoJSON file. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisSupportedPropertyType(String columnName, int sqlTypeId, String sqlTypeName) Return true is the SQL type is supported by the GeoJSON driver.voidwrite(org.h2gis.api.ProgressVisitor progress, String tableName, File fileName, String encoding, boolean deleteFile) Write the spatial table to GeoJSON format.voidwrite(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File fileName, String encoding, boolean deleteFile) Write a resulset to a geojson file
-
Constructor Details
-
GeoJsonWriteDriver
A simple GeoJSON driver to write a spatial table to a GeoJSON file.- Parameters:
connection-
-
-
Method Details
-
write
public void write(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File fileName, String encoding, boolean deleteFile) throws SQLException, IOException Write a resulset to a geojson file- Parameters:
progress-rs- input resulsetfileName- the output fileencoding-deleteFile-- Throws:
SQLExceptionIOException
-
write
public void write(org.h2gis.api.ProgressVisitor progress, String tableName, File fileName, String encoding, boolean deleteFile) throws SQLException, IOException Write the spatial table to GeoJSON format.- Parameters:
progress-tableName-fileName-encoding-deleteFile-- Throws:
SQLExceptionIOException
-
isSupportedPropertyType
public boolean isSupportedPropertyType(String columnName, int sqlTypeId, String sqlTypeName) throws SQLException Return true is the SQL type is supported by the GeoJSON driver.- Parameters:
sqlTypeId-sqlTypeName-- Returns:
- Throws:
SQLException
-