Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 120
Registered: ‎10-13-2015

Geopackage json configuration

Hi,

 

We are trying to generate a json configuration file with multiple geopackage database in the same legend entry.

Our finally objective is to have only 2 layers in the legend. 1 layer with osm and 1 layer with all gpkg.

 

Steps: Example with 2 gpkg

 

  • We created 2 services

 

 

"services": [{
"id": "osmServiceId",
"name": "Open Street Map",
"type": "osmService",
"url": "http://{a,b,c}.tile.openstreetmap.org"
}, {
"id": "GIOSDbServiceId",
"name": "HCWA",
"type": "db",
"dbType": "gpkg",
"connectionString": "barcelona.gpkg",
"serviceMetadata": "GIOSDbServiceMetadataId"
}, {
"id": "GIOSDbServiceId1",
"name": "HCWA1",
"type": "db",
"dbType": "gpkg",
"connectionString": "barcelona_lukasz.gpkg",
"serviceMetadata": "GIOSDbServiceMetadataId"
}
 

 

 

  • We created 2 featureSourceDescriptions. In this case both gpkg have the same layerName.

 

"featureSourceDescriptions": [{
"id": "osmFsdId",
"type": "slippyMapLayer",
"service": "osmServiceId"
}, {
"id": "giosDbFsdId",
"type": "dbTileLayer",
"layerName": "Districtes",
"service": "GIOSDbServiceId"
}, {
"id": "giosDbFsdId1",
"type": "dbTileLayer",
"layerName": "Districtes",
"service": "GIOSDbServiceId1"
}

 

  • We created 2 datasets
"datasets": [{
"id": "osmDatasetId",
"sources": [
"osmFsdId"
]
}, {
"id": "giosDataseId",
"sources": [
"giosDbFsdId","giosDbFsdId1"
]
}],

 

  • And finally we defined the legend
"legends": [{
"id": "legendId",
"name": "GIOS Data",
"entries": [{
"id": "osmDatasetId",
"dataset": "osmDatasetId",
"visible": true
}, {
"id": "giosDataseId",
"dataset": "giosDataseId",
"visible": true
}]
}],

 

It's possible to have multiple gpkg in the same legend entry?

Can you send an example?

I send you our current json file.

 

 

Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: Geopackage json configuration

Hi,

 

let me ask the question first: why do you want to have multiple geopackage databases in the same legend entry?

Frequent Contributor
Posts: 120
Registered: ‎10-13-2015

Re: Geopackage json configuration

Maybe not is necesary and there are another solution.

I try to explain our scenario with an example

 

  • For levels 8,9,10 we would like to show the districts and the districts name
  • For levels 11, 12 we would like to show the barris and barris name
  • For levels 13, 14, 15, 16 ... we would like to show the parcels, street numbers,..

 

Our first idea was create a multiple tables but in the community documentation saw that the gdaladdo tool not works with multiple tables.

http://community.hexagongeospatial.com/t5/Developers-Knowledge-Base/Generating-a-GeoPackage-database...

 

Any idea are welcome.

 

 

 

Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: Geopackage json configuration

  • It isn't possible to have one legend entry pointing multiple GeoPackages.
  • It is possible to generate using GDAL a GeoPackage with multiple layers.
  • I couln't find and option in GDAL to generate raster pyramid, neither with separate request for each zoom level, nor by merging multiple GeoPackages.

We documented GDAL addo as the only one that was working out of the box.

 

Having said that we've been discussing the solution with separate request for each zoom level. If you have a WMS with all the layers and zoom levels (scale denominators) properly configured, the solution would enable you to generate one GeoPackage with one table. Having one GeoPackage with one table, you can display it under one legend entry.

 

The simplest way to achieve it would be to generate each pyramid zoom level seprately and merge it in script or program.

 

If we are to do it you should talk about it with Vince or Dominik.