Class DbsHelper


  • public class DbsHelper
    extends Object
    Database spatial helper methods.
    Author:
    Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • DbsHelper

        public DbsHelper()
    • Method Detail

      • runRawSqlToFeatureCollection

        public static org.geotools.feature.DefaultFeatureCollection runRawSqlToFeatureCollection​(String name,
                                                                                                 ASpatialDb db,
                                                                                                 String simpleSql,
                                                                                                 org.locationtech.jts.geom.Polygon roi)
                                                                                          throws Exception
        Extractes a featurecollection from an sql statement.

        The assumption is made that the first string after the FROM keyword in the select statement is the table that contains the geometry.

        Parameters:
        name - the name of the resulting layer.
        db -
        simpleSql - the sql.
        roi - an optional region to limit the query to.
        Returns:
        the features.
        Throws:
        Exception