LarsSchy / SMAC-M

Scripts to convert nautical data and display it with Mapserver
MIT License
66 stars 33 forks source link

Layer 7 and nothing to be shown after requesting map in mapserver #29

Open hz658832 opened 3 years ago

hz658832 commented 3 years ago

Hey Simon, I would like to ask you whether you can help me.

I have finished converting the S57 chart in to *.map based on your tutorial and have two questions / problems.

While converting a chart in germay, I got 7 Layers from original data and can see this los while running generate_shapefiles.py ogr2ogr -append -skipfailures -f 'ESRI Shapefile' --config S57_PROFILE iw /home/haoming/Desktop/SMAC-M/shp_s57data/shp/7/CL7_dismar_lcase_POINT.shp -where PRIM=1 /home/haoming/Desktop/DE_INLAND/ENC_ROOT/1W7DE016.000 dismar

It seems that, the 7th folder contains information for "AIRARE" or "bridge" etc...

After generating mapfiles, I started mapserv successfully but seeing nothing while requesting the map using http://localhost/cgi-bin/mapserv?map=/home/haoming/Desktop/map/SeaChart_DAY_BRIGHT.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&LAYERS=SeaChart_DAY_BRIGHT&srs=EPSG:3857&BBOX=812334,6714801,831978,6732420.577302&FORMAT=application/openlayers&WIDTH=2000&HEIGHT=1100

Could you help me with these problem? Do you need more information from my side?

Thank you very much!

Best regards from aachen

Haoming

smercier commented 3 years ago

Hi, is it possible you only need to zoom in at the right spot of your data? Also, ba aware while you using internal OpenLayers format, you may need to uncomment CONFIG "MS_OPENLAYERS_JS_URL" option in the result mapfile (https://github.com/LarsSchy/SMAC-M/blob/master/chart-installation/generate_map_files/resources/templates/SeaChart_THEME.map). If you still have trouble, you should try your WMS in QGIS directly (with OpenStreetMap baselayer - OpenLayers plugin)

1 - Overview (1/30000000) - For route planning and oceanic crossing.
2 - General -(1/10000000) For navigating oceans, approaching coasts and route planning.
3 - Coastal - (1/5000000) For navigating along the coastline, either inshore or offshore.
4 - Approach - (1/1000000) Navigating the approaches to ports or mayor channels or through intricate or congested waters.
5 - Harbour - (1/500000) Navigating within ports, harbours, bays, rivers and canals, for anchorages.
6 - Berthing - (1/100000) Detailed data to aid berthing.
MarekBak commented 3 years ago

As for level 7 it seems to be Inland Electronic Navigational Chart (example of name: P17OD695) . Script generate_shapefiles.py calls generateShapefile.sh which as far as I remember uses 1-6 levels by default. If you patched it and managed to get level 7 then cross check generated SeaChart_DAY_BRIGHT.map. Does it includes level 7? If so then what is the min/max scale? If you want to know what is inside your level 7 enc file then OpenCpn will help you to find objects to look after.

hz658832 commented 3 years ago

OpenLayers plugin

Hi @smercier, thanks a lot for your fast reply and suggestion using QGIS. I have tried with QGIS, both with my S57 charts and the charts in your dataset "US5OH10M" by setting up the WMS client in QGIS using http://localhost/cgi-bin/mapserv?VERSION=1.1.1&map=/home/haoming/Desktop/SMAC-M/shp_s57data/map/SeaChart_DAY_BRIGHT.map.

But without success. The client looks like: Screenshot from 2021-02-22 22-02-00

Could you provide a test chart so that I can test them all? Thank you so much! Bests, haoming

hz658832 commented 3 years ago

As for level 7 it seems to be Inland Electronic Navigational Chart (example of name: P17OD695) . Script generate_shapefiles.py calls generateShapefile.sh which as far as I remember uses 1-6 levels by default. If you patched it and managed to get level 7 then cross check generated SeaChart_DAY_BRIGHT.map. Does it includes level 7? If so then what is the min/max scale? If you want to know what is inside your level 7 enc file then OpenCpn will help you to find objects to look after.

Hi @MarekBak, yes indeed. The scripts are only used for 6 layers and my charts are called as 1W7DE0xx.000. I have also checked https://ienccloud.us/ienc_s57.cfm. It seems that all of the data do have 7 layers. So should we extend this project for 7 th layer? And could you be more specific about the patches you mean? One more question: in OpenCPN, once we double click the object on the map, the object information will be queried. Can the converted maps also provide same functionality?

Many thanks!

Bests,

Haoming

MarekBak commented 3 years ago

As for mine project I was using scale attribute instead of thrid letter of filename to qualify enc file for level. The number of output levels stayed the same: from 1 till 6. Additional problem was that some files I've got were overlaping each other while their scale was the same. In such case I was converting files from the oldest to the newest. To evaluate which one is the oldest I was looking for creation timestamp both in base enc file (the one with .000 suffix) and patches files (the ones with same prefix but suffix .001, .002, .003 and so on). Because of all above I've more or less rewritten the generateShapefile.sh

martijn-heil commented 3 years ago

I've basically got layer 7 working in a personal fork of this project which I've forked from another fork of this project. Considering the original author seems rather inactive, maybe it's of some use for you. Feel free to open an issue if you can't get it working. The lights layer doesn't render properly, still need to work on that. https://gitlab.com/martijn-heil/smac-m