Package org.h2gis.functions.io.osm

# Class ST_OSMDownloader

java.lang.Object
org.h2gis.api.AbstractFunction
org.h2gis.functions.io.osm.ST_OSMDownloader

All Implemented Interfaces:
  `org.h2gis.api.Function`, `org.h2gis.api.ScalarFunction`

public class ST_OSMDownloader extends org.h2gis.api.AbstractFunction implements org.h2gis.api.ScalarFunction
This function is used to download data from the osm api using a bounding box.

Author:
  Erwan Bocher

## Field Summary

### Fields inherited from interface org.h2gis.api.Function

`PROP_NAME, PROP_REMARKS`

### Fields inherited from interface org.h2gis.api.ScalarFunction

`PROP_DETERMINISTIC`

## Constructor Summary

Constructors
Constructor
Description
`ST_OSMDownloader()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`downloadData(Connection con, org.locationtech.jts.geom.Geometry area, String fileName)`
`static void`
`downloadData(Connection con, org.locationtech.jts.geom.Geometry area, String fileName, boolean deleteFile)`
`static void`
`downloadOSMFile(File file, org.locationtech.jts.geom.Envelope geometryEnvelope)`
Download OSM file from the official server
`String`
`getJavaStaticMethod()`

### Methods inherited from class org.h2gis.api.AbstractFunction

`addProperty, getProperty, removeProperty`

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

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

### Methods inherited from interface org.h2gis.api.Function

`getProperty`

## Constructor Details

### ST_OSMDownloader

public ST_OSMDownloader()

## Method Details

### getJavaStaticMethod

public String getJavaStaticMethod()

Specified by:
  `getJavaStaticMethod` in interface `org.h2gis.api.ScalarFunction`

### downloadData

public static void downloadData(Connection con, org.locationtech.jts.geom.Geometry area, String fileName) throws FileNotFoundException, IOException, SQLException, org.cts.op.CoordinateOperationException

Parameters:
  `con` - the database connection
  `area` - The geometry used to compute the area set to the OSM server
  `fileName` - The path to save the osm file
Throws:
  `FileNotFoundException`
  `IOException`
  `SQLException`
  `org.cts.op.CoordinateOperationException`

### downloadData

public static void downloadData(Connection con, org.locationtech.jts.geom.Geometry area, String fileName, boolean deleteFile) throws FileNotFoundException, IOException, SQLException, org.cts.op.CoordinateOperationException

Parameters:
  `con` - the database connection
  `area` - The geometry used to compute the area set to the OSM server
  `fileName` - The path to save the osm file
  `deleteFile` - True to delete the file if exists
Throws:
  `FileNotFoundException`
  `IOException`
  `SQLException`
  `org.cts.op.CoordinateOperationException`

### downloadOSMFile

public static void downloadOSMFile(File file, org.locationtech.jts.geom.Envelope geometryEnvelope) throws IOException
Download OSM file from the official server

Parameters:
  `file` -
  `geometryEnvelope` -
Throws:
  `IOException`