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
`GeoJsonWriteDriver​(Connection connection)` A simple GeoJSON driver to write a spatial table to a GeoJSON file.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `isSupportedPropertyType​(String columnName, int sqlTypeId, String sqlTypeName)` Return true is the SQL type is supported by the GeoJSON driver.
`void` `write​(org.h2gis.api.ProgressVisitor progress, String tableName, File fileName, String encoding, boolean deleteFile)` Write the spatial table to GeoJSON format.
`void` `write​(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File fileName, String encoding, boolean deleteFile)` Write a resulset to a geojson file

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GeoJsonWriteDriver

    public GeoJsonWriteDriver​(Connection connection)

A simple GeoJSON driver to write a spatial table to a GeoJSON file.

Parameters:
  `connection` -

### Method Detail

#### 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 resulset
  `fileName` - the output file
  `encoding` -
  `deleteFile` -
Throws:
  `SQLException`
  `IOException`

#### 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:
  `SQLException`
  `IOException`

#### 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`