rsignell-usgs / karen_work

Karen's USGS volunteer issues, code, progress
0 stars 0 forks source link

Can we put background or additional tilesets on the Sandwich dataset? #7

Open rsignell-usgs opened 6 years ago

rsignell-usgs commented 6 years ago

As reported by @csherwood-usgs https://github.com/rsignell-usgs/karen_work/issues/2#issuecomment-347013682, it would be great to have the ability to turn on additional datasets in this same view, as in the Sandwich data we tried on the Melown Cloud data at: https://www.melown.com/cloud/link/93m5EKtdHiYciGhLGVty?pos=obj,-70.479116,41.765413,fix,-24.88,0.00,-50.00,0.00,735.46,45.00

ladislavhorky commented 6 years ago

Hi, just for reference: it is perfectly possible but it calls for more complex setup. I recommend reading http://vtsdocs.melown.com/en/latest/tutorials/cadastre.html and http://vtsdocs.melown.com/en/latest/tutorials/bing-maps.html tutorial. You will definitely need global (or at least large enough) DEM and orthophoto.

rsignell-usgs commented 6 years ago

Or I guess the other possibility is viewing the melown tiled services in another client, such as TerriaJS (which is based in Cesium). Like adding as service here: https://nationalmap.gov.au/#share=s-cLeRBM5Yin1pyAF8i3XOoZraR1y Do you know if that's possible?

ladislavhorky commented 6 years ago

In principle, it should be possible but we are not currently actively developing anything connected to this. Have you made any progress or further research in that direction based on the VTS format specs we sent you?

k-rns commented 6 years ago

Hi there again @ladislavhorky @rsignell-usgs, I am having some trouble trying to get a vector layer on my surface.

Using the Mars tutorial I`ve set up a dem (dynamic surface - terrain) and a draped ortho layer (bound layer - global mosaic) of a particular beach on our server. Now I want to put sampling locations (vector layer) on it by following the Cadastre tutorial.

Reading the Cadastre tutorial, it seems like I don't have to do anything extra for the dem and ortho layer, so I haven't set them up again or changed anything to those layers. They each have their dataset directory and configuration file at these locations:

/var/vts/mapproxy/datasets/sandwich/sandwich_dem_resampling (containing dem, dem.min, dem.max, tiling)
/var/vts/mapproxy/datasets/sandwich/sandwich_ortho
/etc/vts/mapproxy/sandwich.d/sandwich_dem.json
/etc/vts/mapproxy/sandwich.d/sandwich_ortho.json

I`ve set up the vector layer (converted kml to mbttiles) and it has its own dataset and configuration files at these location:

/var/vts/mapproxy/datasets/sandwich/vector (containing mbtiles)
/etc/vts/mapproxy/sandwich.d/sandwich_vector.json

this vector configuration file looks like this:

[{
   "comment": "Data source",
   "group": "sandwich",
   "id": "vector",
   "type": "geodata",
   "driver": "geodata-vector-tiled",
   "credits": ["USGS eastern region"],
   "definition": {
       "dataset": "sandwich/vector/sampling_locations_20180110.mbtiles/{loclod}-{locx}-{locy}"
       , "demDataset": "sandwich/sandwich_dem_resampling"
       , "geoidGrid": "egm96_15.gtx"
       , "format": "geodataJson"
       , "displaySize": 1024
   },
   "registry": {
       "credits" : {"USGS eastern region":{ "id": 206, "notice": "USGS - Chris Sherwood" }}
   },
   "referenceFrames":
       {
           "melown2015": {
               "tileRange": [
                   [4983, 6095],
                   [4984, 6096]
               ],
               "lodRange": [15, 23]
           }
       }
}]

I`m getting several errors (see below) and subsequently this vector layer is not being displayed.

2018-02-06 17:11:08 W2 [9121(updater)]: Definition of resource <melown2015/sandwich/sandwich_dem_resampling> differs from the one stored in store at "/var/vts/mapproxy/store/melown2015/sandwich/sandwich_dem_resampling"; using stored definition. {generator.cpp:changed():143}
2018-02-06 17:11:08 W3 [9121(updater)]: Definition of resource <melown2015/sandwich/vector> differs from the one stored in store at "/var/vts/mapproxy/store/melown2015/sandwich/vector"; using stored definition. {generator.cpp:Generator():126}
2018-02-06 17:11:08 E2 [9121(updater)]: gdal error 4: /var/vts/mapproxy/datasets/sandwich_dem_resampling/dem: No such file or directory {geodataset.cpp:GDALErrorHandler():72}
2018-02-06 17:11:08 E2 [9121(updater)]: Failed to open dataset "/var/vts/mapproxy/datasets/sandwich_dem_resampling/dem". {geodataset.cpp:open():328}
2018-02-06 17:11:08 E2 [9121(updater)]: Failed to create generator for resource <melown2015/sandwich/vector>: <Failed to open dataset "/var/vts/mapproxy/datasets/sandwich/sandwich_dem_resampling/dem". @{geodataset.cpp:open():328}>. {generator.cpp:operator()():667}

Could you give me a direction where it did go wrong? Was it wrong to not reset the dem and ortho layer? Is it ok to put the mbttiles in a separate vector folder in the sandwich dataset folder? The set-up of the configuration files for the vector layer differs from the configuration files for the surfaces (i.e. the geoidGrid is not defined in the mosaic and dem configuration, there is a different location of lodRange and tileRange defintion, ....), is that of importance? For the fourth error, I know the path is wrong, but I don't know where I should adjust this.

Thanks!

ladislavhorky commented 6 years ago

Hi again @k-rns ,

the mapproxy freezes resource definitions in its store. If the original data was moved and configuration was properly adjusted, the frozen paths (that is where you get the gdal errors) will be wrong. The freezing is important for production environment but here it is more of a trouble. There is fortunately an easy workaround - you just need to get rid of the store:

If you changed nothing but the paths in resources and the paths are all correct, this should be fine.

If the vector data you are setting up are quite small - like few (hundreds) points across the beach I saw, it may be easier to set them up as monolitic using the http://vtsdocs.melown.com/en/latest/tutorials/mars-peaks-and-valleys-searchable-nomenclature.html#the-labels tutorial. Apart from .shp it should work with any OGR-readable format (e.g. GeoJson or maybe even the original .kml)

ladislavhorky commented 6 years ago

As for the other questions:

k-rns commented 6 years ago

Thanks a lot for the help @ladislavhorky ! Everything seems to work right now, no errors or anything. I don't see the locations on my map though, I think I have to adjust the /var/vts//mapproxy/datasets/sandwich/vector/sampling_locations.style file.

Right now, I just copied the content from this tutorial to the .style file. What should I adjust in this .style file to just see big red dots? So I know that at least the layer is there :)

ladislavhorky commented 6 years ago

Hi, good to hear that. If in doubt about styles, @DavidLevinsky could give you some hints or direct you to some useful information.