Class 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
    • Constructor Detail

      • ST_OSMDownloader

        public ST_OSMDownloader()
    • Method Detail

      • 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,
                                        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