Package org.h2gis.functions.io.geojson
Class GeoJsonWriteDriver
- java.lang.Object
-
- org.h2gis.functions.io.geojson.GeoJsonWriteDriver
-
public class GeoJsonWriteDriver extends Object
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
Constructors Constructor Description GeoJsonWriteDriver(Connection connection)A simple GeoJSON driver to write a spatial table to a GeoJSON file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisSupportedPropertyType(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 Detail
-
GeoJsonWriteDriver
public GeoJsonWriteDriver(Connection connection)
A simple GeoJSON driver to write a spatial table to a GeoJSON file.- Parameters:
connection- database connection
-
-
Method Detail
-
write
public void write(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File fileName, String encoding, boolean deleteFile) throws SQLException, IOExceptionWrite a resulset to a geojson file- Parameters:
progress- Progress visitor following the execution.rs- input resulsetfileName- the output fileencoding- file encodingdeleteFile- true to delete the file if exist- Throws:
SQLExceptionIOException
-
write
public void write(org.h2gis.api.ProgressVisitor progress, String tableName, File fileName, String encoding, boolean deleteFile) throws SQLException, IOExceptionWrite the spatial table to GeoJSON format.- Parameters:
progress- Progress visitor following the execution.tableName- table namefileName- input fileencoding- file encodingdeleteFile- true to delete the file if exist- 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:
columnName- column namesqlTypeId- sql type idsqlTypeName- sql type name- Returns:
- true if the column is supported
- Throws:
SQLException
-
-