1

I'mtrying to make an automatic raster data import to GeoServer for later use in an OpenLayers web application in which i need to add raster files frequently, so I added Image Mosaic JDBC Plugin and configured it following this tutorial, but I end up with this error :

java -jar C:/"Program Files (x86)"/"GeoServer 2.15.0"/webapps/geoserver/WEB-INF/lib/gt-imagemosaic-jdbc-21.2.jar ddl -config /  C:/"Program Files (x86)"/"GeoServer 2.15.0"/data_dir/coverages/osm.postgis.xml -spatialTNPrefix ne_raster -pyramids 6 -statementDelim ";" -srs 4326 -targetDir ne_raster_sqlscripts
[Fatal Error] :1:1: Content is not allowed in prolog.
Aug 18, 2019 9:23:58 PM org.geotools.gce.imagemosaic.jdbc.DDLGenerator start
INFO:
org.xml.sax.SAXParseException; systemId: file:/C:/; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.geotools.gce.imagemosaic.jdbc.Config.readFrom(Config.java:140)
        at org.geotools.gce.imagemosaic.jdbc.DDLGenerator.start(DDLGenerator.java:113)
        at org.geotools.gce.imagemosaic.jdbc.Toolbox.main(Toolbox.java:47)

I also tried to follow this tuto using GeoServer 2.15 and PGRaster 2.15 but still getting errors when save

Could not list layers for this store, an error occurred retrieving them:
Failed to create reader from file:data/trees.pgraster.xml and hints 
Hints:
EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@a39986[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] 
REPOSITORY = org.geoserver.catalog.CatalogRepository@1a376a4 System 
defaults: FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@17186db 
FORCE_AXIS_ORDER_HONORING = http GRID_COVERAGE_FACTORY = GridCoverageFactory 
TILE_ENCODING = null 
LENIENT_DATUM_SHIFT = true 
STYLE_FACTORY = StyleFactoryImpl 
FORCE_LONGITUDE_FIRST_AXIS_ORDER = true 
COMPARISON_TOLERANCE = 1.0E-8 
FILTER_FACTORY = FilterFactoryImpl 

I don't know if there's something I missed or those plugins are just buggy.

trees.pgraster.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE ImageMosaicJDBCConfig [ <!ENTITY mapping PUBLIC "mapping" "mapping.pgraster.xml.inc"> <!ENTITY connect PUBLIC "connect" "connect.pgraster.xml.inc"> ]> <config version="1.0"> <coverageName name="oek"/> <coordsys name="EPSG:3763"/> tried 4326 also <scaleop interpolation="1"/> <axisOrder ignore="false"/> &mapping; &connect; </config> connect.pgraster.xml.inc <connect> <!-- value DBCP or JNDI --> <dstype value="DBCP"/> <!-- <jndiReferenceName value=""/> --> <username value="postgres" /> <password value="geoinfo" /> <jdbcUrl value="jdbc:postgresql://localhost:5432/ArbresZones" /> <driverClassName value="org.postgresql.Driver"/> <maxActive value="500"/> <maxIdle value="0"/> </connect> mapping.pgraster.xml.inc <spatialExtension name="pgraster"/> <mapping> <masterTable name="mosaic" > <coverageNameAttribute name="name"/> <maxXAttribute name="maxX"/> <maxYAttribute name="maxY"/> <minXAttribute name="minX"/> <minYAttribute name="minY"/> <resXAttribute name="resX"/> <resYAttribute name="resY"/> <tileTableNameAtribute name="tiletable" /> </masterTable> <tileTable> <blobAttributeName name="rast" /> </tileTable> </mapping>

1 Answers1

1

GeoServer REST API is your best option build a form for upload data and post to Geo server build WMS and WMTS

  • REST API in cmd windows did the work trying to make it work on ajax https://gis.stackexchange.com/questions/332581/curl-rest-api-to-ajax – Ayoub Beltarchi Aug 21 '19 at 21:24