[mapserver-users] Using MBTiles with MapServer

2022-04-25 Thread Carl Godkin
Hi,

I have a working MapServer WMS server where the size of the input imagery
data is becoming a concern.

I used gdal_translate to convert our input satellite imagery files to
.mbtiles format and it's now about 20% of the size of the GeoTIFF files I
had been using before.  (The GeoTIFF files are compressed and have
overviews.)  This seems promising.

I have added a new LAYER to my .map file for the converted data but I
cannot get MapServer to display the imagery as I expected.  It's all black
(or more likely, transparent).

As a test, I converted  one of the .mbtiles files back to GeoTIFF and it
still looks fine to me so I don't think my conversion (a pretty simple
gdal_translate command line) messed it up.

I have the debug logging in MapServer set to 5 and can see the queries
coming through and no obvious errors.  For instance:

# shp2img -m mapserver.map -l "NAIP_mbtiles" -o /test.png -all_debug 5
msLoadMap(): 0.010s
msDrawMap(): rendering using outputformat named GEOTIFF (GDAL/GTiff).
msDrawMap(): WMS/WFS set-up and query, 0.000s
msDrawRasterLayerLow(NAIP_mbtiles): entering.
freeLayer(): freeing layer at 0x55d543267ac0.
msDrawMap(): Layer 2 (NAIP_mbtiles), 0.005s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.006s
msSaveImage(/test.png) total time: 0.011s
msFreeMap(): freeing map at 0x55d542ee5680.
freeLayer(): freeing layer at 0x55d543223250.
freeLayer(): freeing layer at 0x55d5432262e0.
freeLayer(): freeing layer at 0x55d54323e350.
shp2img total time: 0.026s

I using the "camptocamp" docker image for MapServer and it has this version:

# mapserv -v
MapServer version 7.6.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS
SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS
SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE

As far as I can tell, its version of GDAL supports MBTiles.  (It's listed
among the "gdalinfo --formats" output among other evidence.)

Does anyone have any suggestions?  I can't find discussion of the .mbtiles
format in the docs except around Mapcache and Google hasn't found me
anything useful so far.

Thanks a lot,

carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] WCS layer units question...

2022-01-13 Thread Carl Godkin
 Hi Jukka,

Thanks for pasting in your METADATA.  I copied yours to my map file and,
sure enough, I finally see the uom displayed!

After some experiments, I discovered that "wcs_band_names" is required if
you want to affect the metadata.  It actually says this in the
documentation but I overlooked it.

Once I added that, then I see my desired uom displayed by GetCoverage.
Hooray!

Thanks again for all of the help,

carl



On Thu, Jan 13, 2022 at 1:05 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> I can only tell that with these metadata settings in my mapfile
>
> METADATA
>
>   "wcs_label""orto_vv"  ### required
>
>   "wcs_resolution" "0.5 0.5"
>
>   "wcs_imagemode" "BYTE"
>
>   "wcs_bandcount" "3"
>
>   "wcs_band_names" "Band1 Band2 Band3"
>
>   "wcs_timeposition"
> "2000-11-11T11:11:11Z,2001-11-11T11:11:11Z"
>
>   "Band1_band_description""NIR range 700-900 nm"
>
>   "Band2_band_description""Red range 600-700 nm"
>
>   "Band3_band_description""Green range 500-600"
>
>   "Band1_band_uom" "foo"
>
>   "Band2_band_uom" "bar"
>
>   "Band3_band_uom" "foobar"
>
>   "wcs_rangeset_axis" "E,N"
>
>
>
>   "wcs_extent"  "212000.000 6762000.000 218000.000
> 6768000.000"
>
>   "wcs_rangeset_name"   "Range 1"  ### required to support
> DescribeCoverage request
>
>   "wcs_rangeset_label"  "My Label" ### required to support
> DescribeCoverage request
>
> END
>
> I can see for example this in DescribeCoverage
> 
>
> 
>
> Green range 500-600
>
> 
>
> 
>
>
>
> I have the same version 7.7.0-dev (MS4W 4.0.5).
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* torstai 13. tammikuuta 2022 2.45
> *Vastaanottaja:* Mapserver-Users (mapserver-users@lists.osgeo.org) <
> mapserver-users@lists.osgeo.org>
> *Aihe:* Re: [mapserver-users] WCS layer units question...
>
>
>
> Hi Jukka,
>
>
>
> Thanks for the documentation pointer.  I have attached a .map file in
> which I have all three of the possibilities
>
>
>
>   # Trying all three.  My single band is called "band"
>   "wcs_band_uom"  "m"
>   "ows_band_uom"  "m"
>   "band_band_uom"  "m"
>
>
>
> but I still only see
>
>
>
> 
>
>
>
> from DescribeCoverage.  I am very curious to know what I've overlooked!
>
>
>
> By the way, I'm running MapServer from the "camptocamp" docker image.  It
> appears to by MapServer 7.7-dev.
>
>
>
> Thanks so much,
>
> carl
>
>
>
> On Wed, Jan 12, 2022 at 9:47 AM Rahkonen Jukka (MML) <
> jukka.rahko...@maanmittauslaitos.fi> wrote:
>
> Hi,
>
>
>
> Sorry, I thought that our service is open. This should work
> https://demo.mapserver.org/cgi-bin/wcs?SERVICE=wcs=2.0.0=DescribeCoverage=modis
>
>
>
> The default value of uom is documented in
> https://www.mapserver.org/ogc/wcs_server.html
>
> “If no specific or default value is given, the output is dependent on the
> metadata key. The UOM, for example will be set to ‘W.m-2.Sr-1’”
>
>
>
> WCS metadata keywords, including “{band_name}_band_uom” work for us. I am
> sure that you will make it to work as well but if you won’t, show us your
> mapfile.
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* keskiviikko 12. tammikuuta 2022 17.13
> *Vastaanottaja:* Mapserver-Users (mapserver-users@lists.osgeo.org) <
> mapserver-users@lists.osgeo.org>
> *Aihe:* Re: [mapserver-users] WCS layer units question...
>
>
>
> Thanks for the reply, Jukka.
>
>
>
> I found "wcs_band_uom" in the docs but I can't seem to make the value I
> put into my map file appear in the DescribeCoverage output.  (The link you
> sent doesn't work for me.)
>
>
>
> I do see this though:
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> -3.4028e+38 3.4028e+38
>

Re: [mapserver-users] WCS layer units question...

2022-01-12 Thread Carl Godkin
Hi Jukka,

Thanks for the documentation pointer.  I have attached a .map file in which
I have all three of the possibilities

  # Trying all three.  My single band is called "band"
  "wcs_band_uom"  "m"
  "ows_band_uom"  "m"
  "band_band_uom"  "m"

but I still only see



from DescribeCoverage.  I am very curious to know what I've overlooked!

By the way, I'm running MapServer from the "camptocamp" docker image.  It
appears to by MapServer 7.7-dev.

Thanks so much,
carl

On Wed, Jan 12, 2022 at 9:47 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> Sorry, I thought that our service is open. This should work
> https://demo.mapserver.org/cgi-bin/wcs?SERVICE=wcs=2.0.0=DescribeCoverage=modis
>
>
>
> The default value of uom is documented in
> https://www.mapserver.org/ogc/wcs_server.html
>
> “If no specific or default value is given, the output is dependent on the
> metadata key. The UOM, for example will be set to ‘W.m-2.Sr-1’”
>
>
>
> WCS metadata keywords, including “{band_name}_band_uom” work for us. I am
> sure that you will make it to work as well but if you won’t, show us your
> mapfile.
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* keskiviikko 12. tammikuuta 2022 17.13
> *Vastaanottaja:* Mapserver-Users (mapserver-users@lists.osgeo.org) <
> mapserver-users@lists.osgeo.org>
> *Aihe:* Re: [mapserver-users] WCS layer units question...
>
>
>
> Thanks for the reply, Jukka.
>
>
>
> I found "wcs_band_uom" in the docs but I can't seem to make the value I
> put into my map file appear in the DescribeCoverage output.  (The link you
> sent doesn't work for me.)
>
>
>
> I do see this though:
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> -3.4028e+38 3.4028e+38
>
> 12
>
> 
>
> 
>
> 
>
> 
>
>
>
> The "swe:uom code" would seem to be what I want to affect.  For some
> reason I see the value "watts per square meter per steradian" which appears
> nowhere in my map file so I wonder if it's some sort of default baked into
> the code or something.  (I had seen that before but hadn't bothered to try
> to figure out what it was until just now.  That's weird.)
>
>
>
> Thanks for your help,
>
>
>
> carl
>
>
>
>
>
>
>
> On Tue, Jan 11, 2022 at 11:57 PM Rahkonen Jukka (MML) <
> jukka.rahko...@maanmittauslaitos.fi> wrote:
>
> Hi,
>
>
>
> WCS users are supposed to read the metadata with DescribeCoverage, for
> example
> https://avoin-visukuva.nls.fi/ortokuvat-ja-korkeusmallit/wcs/v1?service=WCS=2.0.1=DescribeCoverage=ortokuva_vari
>
> The units can be configured in the mapfile with “wcs_band_uom”. I do not
> know if it is possible to configure the outputformat to write uom also into
> the TIFF. That is something that GDAL should do.
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* keskiviikko 12. tammikuuta 2022 3.58
> *Vastaanottaja:* Mapserver-Users (mapserver-users@lists.osgeo.org) <
> mapserver-users@lists.osgeo.org>
> *Aihe:* [mapserver-users] WCS layer units question...
>
>
>
> Hi,
>
>
>
> I have a local WCS & WMS server.
>
>
>
> I am trying to figure out if I can somehow define the Z units of a terrain
> layer I'm serving.
>
>
>
> The single band from the individual GeoTIFF files providing the terrain
> data looks like this (from gdalinfo):
>
>
>
> Band 1 Block=512x512 Type=Float32, ColorInterp=Gray
>   Description = Layer_1
>   NoData Value=-99
>   Unit Type: m <= units are meters
>   Metadata:
> LAYER_TYPE=athematic
> RepresentationType=ATHEMATIC
>
>
>
> but when I download a GeoTIFF using a WCS GetCoverage request on this
> layer, the GeoTIFF's single band just looks like this:
>
>
>
> Band 1 Block=571x3 Type=Float32, ColorInterp=Gray
>
>
>
> without "Unit Type."
>
>
>
> I also tried using
>
>UNITS Meters
>
> in my LAYER definition in my map file (copying an example I found among
> the case studies on the web site) but it didn't seem to have any effect.
>
>
>
> Is there some way to define and retrieve the Z units for a WCS server?
>
>
>
> Thanks very much.
>
>
>
> carl
>
>
MAP
  NAME "example"  # Short name prepended to map, legend and scalebar filenames 
  STATUS 

Re: [mapserver-users] WCS layer units question...

2022-01-12 Thread Carl Godkin
Thanks for the reply, Jukka.

I found "wcs_band_uom" in the docs but I can't seem to make the value I put
into my map file appear in the DescribeCoverage output.  (The link you sent
doesn't work for me.)

I do see this though:







-3.4028e+38 3.4028e+38
12





The "swe:uom code" would seem to be what I want to affect.  For some reason
I see the value "watts per square meter per steradian" which appears
nowhere in my map file so I wonder if it's some sort of default baked into
the code or something.  (I had seen that before but hadn't bothered to try
to figure out what it was until just now.  That's weird.)

Thanks for your help,

carl



On Tue, Jan 11, 2022 at 11:57 PM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> WCS users are supposed to read the metadata with DescribeCoverage, for
> example
> https://avoin-visukuva.nls.fi/ortokuvat-ja-korkeusmallit/wcs/v1?service=WCS=2.0.1=DescribeCoverage=ortokuva_vari
>
> The units can be configured in the mapfile with “wcs_band_uom”. I do not
> know if it is possible to configure the outputformat to write uom also into
> the TIFF. That is something that GDAL should do.
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* keskiviikko 12. tammikuuta 2022 3.58
> *Vastaanottaja:* Mapserver-Users (mapserver-users@lists.osgeo.org) <
> mapserver-users@lists.osgeo.org>
> *Aihe:* [mapserver-users] WCS layer units question...
>
>
>
> Hi,
>
>
>
> I have a local WCS & WMS server.
>
>
>
> I am trying to figure out if I can somehow define the Z units of a terrain
> layer I'm serving.
>
>
>
> The single band from the individual GeoTIFF files providing the terrain
> data looks like this (from gdalinfo):
>
>
>
> Band 1 Block=512x512 Type=Float32, ColorInterp=Gray
>   Description = Layer_1
>   NoData Value=-99
>   Unit Type: m <= units are meters
>   Metadata:
> LAYER_TYPE=athematic
> RepresentationType=ATHEMATIC
>
>
>
> but when I download a GeoTIFF using a WCS GetCoverage request on this
> layer, the GeoTIFF's single band just looks like this:
>
>
>
> Band 1 Block=571x3 Type=Float32, ColorInterp=Gray
>
>
>
> without "Unit Type."
>
>
>
> I also tried using
>
>UNITS Meters
>
> in my LAYER definition in my map file (copying an example I found among
> the case studies on the web site) but it didn't seem to have any effect.
>
>
>
> Is there some way to define and retrieve the Z units for a WCS server?
>
>
>
> Thanks very much.
>
>
>
> carl
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] WCS layer units question...

2022-01-11 Thread Carl Godkin
Hi,

I have a local WCS & WMS server.

I am trying to figure out if I can somehow define the Z units of a terrain
layer I'm serving.

The single band from the individual GeoTIFF files providing the terrain
data looks like this (from gdalinfo):

Band 1 Block=512x512 Type=Float32, ColorInterp=Gray
  Description = Layer_1
  NoData Value=-99
  Unit Type: m <= units are meters
  Metadata:
LAYER_TYPE=athematic
RepresentationType=ATHEMATIC

but when I download a GeoTIFF using a WCS GetCoverage request on this
layer, the GeoTIFF's single band just looks like this:

Band 1 Block=571x3 Type=Float32, ColorInterp=Gray

without "Unit Type."

I also tried using
   UNITS Meters
in my LAYER definition in my map file (copying an example I found among the
case studies on the web site) but it didn't seem to have any effect.

Is there some way to define and retrieve the Z units for a WCS server?

Thanks very much.

carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Trouble with OpenStreetMap data in MapServer

2021-11-19 Thread Carl Godkin
Hi Jörg, aimdev, and Jukka,

Thanks for all of the help!

I turned "buildings3" off with LAYER/STATUS OFF and found that rerunning
the shp2img now works fine.

But then trying the very next step, which is using this URL in the browser:

   http://localhost/cgi-bin/mapserv.exe?
 mode=browse&
 template=openlayers&
 layers=all&
 map=C:/ms4w/apps/osm/basemaps/osm-google.map

fails with the same old error because of my old friend "buildings3."

So I changed these

MINSCALEDENOM 999
MAXSCALEDENOM 999

and now that works.   (I guess layers=all means ALL LAYERS even if STATUS
is OFF.)

I have now made it all the way through the instructions in Jeff's tutorial
and am ready to strike out on my own.

Thanks very much for your help,

carl


On Thu, Nov 18, 2021 at 2:03 PM Carl Godkin  wrote:

> Hi,
>
> I am following the instructions for using OpenStreetMap data in MapServer
> here:
>
> https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows
>
> I've been almost all the way through the steps getting everything to work
> until I reached the step "Testing with shp2img" which says to run this:
>
>   shp2img -m osm-google.map -o output.png -map_debug 3
>
> It fails, like this:
>
> msDrawMap(): rendering using outputformat named png (AGG/PNG).
> msDrawMap(): WMS/WFS set-up and query, 0.000s
> msPostGISLayerWhichShapes(): Error (out of memory for query result
> ) executing query: SELECT "name"::text,ST_AsBinary(("geometry"),'NDR') as
> geom,"osm_id"::text FROM (select geometry,osm_id, name as name from
> osm_new_buildings) as foo WHERE "geometry" &&
> ST_GeomFromText('POLYGON((-20037508.3427892
> -3113412.49464005,-20037508.3427892 15861721.9613068,-1062373.88684241
> 15861721.9613068,-1062373.88684241 -3113412.49464005,-20037508.3427892
> -3113412.49464005))',3857)
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check
> server logs
> msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'.
> msDrawMap(): Image handling error. Failed to draw layer named
> 'buildings3'. 
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check
> server logs 
>
> --
> I don't see anything in the MapServer logs and don't really understand
> what is wrong.
>
> I tried specifying individual layers with "-l " to the shp2img
> command and most of them work, which I find encouraging.
> Specifying layer "buildings3" which failed above still fails when
> specified individually.
>
> I'm using Postgres 14, MS4W 4.0.5, MapServer 7.6.4 on Windows 10.
>
> Inspecting the "osm-google.map" file doesn't show me anything very strange
> but I'm no expert.  I pasted the LAYER section for "buildings3" at the
> bottom in case someone spots anything.
> (The process used to generate this file is ... well ... amazing!)
>
> I am using data from geofabric.de for the USA (
> http://download.geofabrik.de/north-america/us-latest.osm.pbf) downloaded
> two days ago.
>
> Does anyone have any suggestions on getting to the bottom of this?  I feel
> like I'm tantalizingly close!
>
> Thanks a lot,
>
> carl
>
> ---
> LAYER
> STATUS ON
> PROJECTION
> "init=epsg:3857"
> END
> GROUP "default"
> NAME "buildings3"
> TYPE POLYGON
> CONNECTIONTYPE postgis
> CONNECTION "host=localhost dbname=osm user=postgres password=postgres
> port=5432"
> DATA "geometry from (select geometry,osm_id, name as name from
> osm_new_buildings) as foo using unique osm_id using srid=3857"
> LABELITEM "name"
> PROCESSING "LABEL_NO_CLIP=ON"
> PROCESSING "CLOSE_CONNECTION=DEFER"
> MAXSCALEDENOM 83202051
> MINSCALEDENOM 41601025
> CLASS
>   STYLE
>  COLOR "#bb"
>  OPACITY 50
>   END
>   STYLE
>  OUTLINECOLOR "#33"
>  WIDTH 0
>   END
>END
> END
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Trouble with OpenStreetMap data in MapServer

2021-11-18 Thread Carl Godkin
Hi,

I am following the instructions for using OpenStreetMap data in MapServer
here:

https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows

I've been almost all the way through the steps getting everything to work
until I reached the step "Testing with shp2img" which says to run this:

  shp2img -m osm-google.map -o output.png -map_debug 3

It fails, like this:

msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawMap(): WMS/WFS set-up and query, 0.000s
msPostGISLayerWhichShapes(): Error (out of memory for query result
) executing query: SELECT "name"::text,ST_AsBinary(("geometry"),'NDR') as
geom,"osm_id"::text FROM (select geometry,osm_id, name as name from
osm_new_buildings) as foo WHERE "geometry" &&
ST_GeomFromText('POLYGON((-20037508.3427892
-3113412.49464005,-20037508.3427892 15861721.9613068,-1062373.88684241
15861721.9613068,-1062373.88684241 -3113412.49464005,-20037508.3427892
-3113412.49464005))',3857)
msPostGISLayerWhichShapes(): Query error. Error executing query. Check
server logs
msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'.
msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'.

msPostGISLayerWhichShapes(): Query error. Error executing query. Check
server logs 

--
I don't see anything in the MapServer logs and don't really understand what
is wrong.

I tried specifying individual layers with "-l " to the shp2img
command and most of them work, which I find encouraging.
Specifying layer "buildings3" which failed above still fails when specified
individually.

I'm using Postgres 14, MS4W 4.0.5, MapServer 7.6.4 on Windows 10.

Inspecting the "osm-google.map" file doesn't show me anything very strange
but I'm no expert.  I pasted the LAYER section for "buildings3" at the
bottom in case someone spots anything.
(The process used to generate this file is ... well ... amazing!)

I am using data from geofabric.de for the USA (
http://download.geofabrik.de/north-america/us-latest.osm.pbf) downloaded
two days ago.

Does anyone have any suggestions on getting to the bottom of this?  I feel
like I'm tantalizingly close!

Thanks a lot,

carl

---
LAYER
STATUS ON
PROJECTION
"init=epsg:3857"
END
GROUP "default"
NAME "buildings3"
TYPE POLYGON
CONNECTIONTYPE postgis
CONNECTION "host=localhost dbname=osm user=postgres password=postgres
port=5432"
DATA "geometry from (select geometry,osm_id, name as name from
osm_new_buildings) as foo using unique osm_id using srid=3857"
LABELITEM "name"
PROCESSING "LABEL_NO_CLIP=ON"
PROCESSING "CLOSE_CONNECTION=DEFER"
MAXSCALEDENOM 83202051
MINSCALEDENOM 41601025
CLASS
  STYLE
 COLOR "#bb"
 OPACITY 50
  END
  STYLE
 OUTLINECOLOR "#33"
 WIDTH 0
  END
   END
END
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Comment on OpenStreetMap tutorial...

2021-11-16 Thread Carl Godkin
Hi (mostly Jeff),

I am going through the excellent MapServer + OpenStreetMap tutorial that
you produced at
https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows .

As you know, it's several versions behind but everything works fine up to
one spot.

Under "Verify PostgreSQL and PostGIS Installation Success" I don't see the
"template_postgis" database discussed under the 7th bullet point:


   - There should be an icon with a red X labeled something like
   "template_postgis" (databases created by postgis install)


.  Instead, I only see the default "postgres" database.  There is a clue
that says

   - Single click 'template_postgis" (Note: with PostgresSQL 11
   Stackbuilder this will not be there; create a db and add the extensions
   yourself using pgAdmin)

but although I was able to create a database called "template_postgis," I
was unable to add the postgis and postgis_topology extensions, perhaps due
to my unfamiliarity with the pgAdmin tool.

I think that the reason is due to the third bullet point under "Install
PostGIS" which says

   - Make sure "Create Database" is not selected

perhaps?  Anyway, I found a workaround.

I opened back up Stack Builder, and reinstalled PostGIS and this time
checked the "Create Database" option.  I named the database
"template_postgis" and the new database seems to be fine.

I would consider making a PR for this page if you thought this was the
right approach.

I am using Postgres 14 on Windows 10 with MS4W 4.0.5 and so far, so good!

Thanks,

carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Point query from Mapserver raster

2021-11-02 Thread Carl Godkin
Thanks for the quick response, Jukka.

I did not realize that X/Y had been replaced by I/J.  I just tried that
instead and it still worked (of course) but I still get the warning message.

I had also been trying WMS 1.1.0 and 1.1.1 earlier and I am unable to find
any combination of versions and other query parameters to quiet the warning
message.

Regarding the BBOX range, I opened the range to a full degree in each
direction and still get the warning.  I think I will stick with the query I
posted originally (with 1.3.0) since it works and just ignore the messages
in the log.

This seems like sort of a hack to me (asking for a box when I want a point,
etc.) which is why I asked my question in the first place.  But it works
fine so I'm happy!

Thanks again,

carl



On Tue, Nov 2, 2021 at 8:29 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> You do not seem to do anything wrong. Your WMS 1.3.0 EPSG:4326 lat-long
> BBOX=42.94,-122.09,42.95,-122.08& gets converted into long-lat order and
> for some reason the lower and higher values are equal
> {-122.082500,42.942500,-122.082500,42.942500}, thus this is no more a box
> but a point.
>
> GetFeatureInfo with a small bbox and width=2 and height=2 is a trick that
> is certainly not heavily tested because the corresponding GetMap is pretty
> odd despite being valid.  Maybe using slightly bigger BBOX makes Mapserver
> to query the backend raster with a rectangle instead of a point.
>
> BTW X=1 and Y=1 are not valid in WMS 1.3.0, you are supposed to use i= and
> j= instead. That makes me think that maybe you could have a try with a full
> and valid WMS 1.1.0 GetFeatureInfo request with SRS= and BBOX in long-lat
> order and see if it has any effect on the msProjectRect()
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* tiistai 2. marraskuuta 2021 17.06
> *Vastaanottaja:* mapserver-users@lists.osgeo.org
> *Aihe:* Re: [mapserver-users] Point query from Mapserver raster
>
>
>
> Hi,
>
>
>
> Following Jukka's advice on my elevation point query, I am trying to use
> WMS GetFeatureInfo,
>
>
>
> I've mostly got it working but have a few more questions.  (I am using
> MS4W 4.0.5 which includes MapServer 7.7.0)
>
>
>
> I added a LAYER to my WMS map file:
>
>
>
>   LAYER
>
> PROCESSING "RESAMPLE=BILINEAR"
>
> NAME SRTM_3_arc-second_grid
>
> METADATA
>
>   "wms_title"   "SRTM - 3 arc-second grid"
>
>   "ows_extent"  "-125 24 -66 50"
>
>   "wms_include_items"   "all"
>
> END
>
>
>
> TYPE RASTER
>
> STATUS ON
>
> TILEINDEX "srtm_3_hgt-index.shp"
>
> TILEITEM "Location"
>
> TEMPLATE "../template.html"
>
> PROJECTION
>
>   "init=epsg:4326"
>
> END
>
>   END
>
>
>
> and an empty template except for the
>
>
>
> 
>
>
>
> line.  Here's my query:
>
>
>
> http://localhost:8080/wms?
>
>   SERVICE=WMS&
>
>   VERSION=1.3.0&
>
>   REQUEST=GetFeatureInfo&
>
>   LAYERS=SRTM_3_arc-second_grid&
>
>   CRS=EPSG:4326&
>
>   BBOX=42.94,-122.09,42.95,-122.08&
>
>   WIDTH=2&
>
>   HEIGHT=2&
>
>   X=1&
>
>   Y=1&
>
>   QUERY_LAYERS=SRTM_3_arc-second_grid
>
>
>
> This works fine and returns the elevation I am expecting.  However, the
> MapServer log complains about a "degenerate rect" every time:
>
>
>
> [Tue Nov  2 07:58:44 2021].66000 msProjectRect(): Warning: degenerate rect
> {-122.082500,42.942500,-122.082500,42.942500}
>
>
>
> What am I doing wrong here?   As I posted originally, I am really only
> interested in a point here.
>
>
>
> Thank you very much,
>
>
>
> carl
>
>
>
>
>
> On Mon, Nov 1, 2021 at 12:58 AM Rahkonen Jukka (MML) <
> jukka.rahko...@maanmittauslaitos.fi> wrote:
>
> Hi,
>
>
>
> The WMS GetFeatureInfo should work and the answer in gis.stackexhange
> seems to contain all the details that you need for making it to work.
>
> With WCS what you did is probably the best you can do with Mapserver. With
> some other servers you may get a single pixel output by using WCS slicing
> (subset=Long(-100)=Lat(22)) or trimming with lowerlimit=upperlimit
> (subset=Long(-100,-100)=Lat(22,22)) but Mapserver does not support
> either. See https://osgeo-org.atlassian.net/browse/GEOS-9553.
>
>
>
> I could not find a link to an answer by Stefan Meissl

Re: [mapserver-users] Point query from Mapserver raster

2021-11-02 Thread Carl Godkin
Hi,

Following Jukka's advice on my elevation point query, I am trying to use
WMS GetFeatureInfo,

I've mostly got it working but have a few more questions.  (I am using MS4W
4.0.5 which includes MapServer 7.7.0)

I added a LAYER to my WMS map file:

  LAYER
PROCESSING "RESAMPLE=BILINEAR"
NAME SRTM_3_arc-second_grid
METADATA
  "wms_title"   "SRTM - 3 arc-second grid"
  "ows_extent"  "-125 24 -66 50"
  "wms_include_items"   "all"
END

TYPE RASTER
STATUS ON
TILEINDEX "srtm_3_hgt-index.shp"
TILEITEM "Location"
TEMPLATE "../template.html"
PROJECTION
  "init=epsg:4326"
END
  END

and an empty template except for the

line. Here's my query:

http://localhost:8080/wms? SERVICE=WMS& VERSION=1.3.0&
REQUEST=GetFeatureInfo& LAYERS=SRTM_3_arc-second_grid& CRS=EPSG:4326& BBOX=
42.94,-122.09,42.95,-122.08& WIDTH=2& HEIGHT=2& X=1& Y=1&
QUERY_LAYERS=SRTM_3_arc-second_grid
This works fine and returns the elevation I am expecting. However, the
MapServer log complains about a "degenerate rect" every time:

[Tue Nov  2 07:58:44 2021].66000 msProjectRect(): Warning: degenerate rect
{-122.082500,42.942500,-122.082500,42.942500}

What am I doing wrong here?   As I posted originally, I am really only
interested in a point here.

Thank you very much,

carl


On Mon, Nov 1, 2021 at 12:58 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> The WMS GetFeatureInfo should work and the answer in gis.stackexhange
> seems to contain all the details that you need for making it to work.
>
> With WCS what you did is probably the best you can do with Mapserver. With
> some other servers you may get a single pixel output by using WCS slicing
> (subset=Long(-100)=Lat(22)) or trimming with lowerlimit=upperlimit
> (subset=Long(-100,-100)=Lat(22,22)) but Mapserver does not support
> either. See https://osgeo-org.atlassian.net/browse/GEOS-9553.
>
>
>
> I could not find a link to an answer by Stefan Meissl about why Mapserver
> does not support slicing but it was about dimensions. A raster image can be
> considered to be two dimensional even when it has only one pixel, but by
> the WCS standard each trim is removing one dimension. Slicing DEM with two
> axes must return a zero dimensional result and raster formats do not
> support that. I still think that subsets with lower=upper limits should
> works and return a single pixel output but that does not work with either
> Mapserver or Geoserver. See also
> https://www.mail-archive.com/search?l=mapserver-users%40lists.osgeo.org=subject:%22%5C%5Bmapserver%5C-users%5C%5D+WCS+GetCoverage+request+one++by+one+pixel%22=newest=1
>
>
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* lauantai 30. lokakuuta 2021 2.10
> *Vastaanottaja:* mapserver-users@lists.osgeo.org
> *Aihe:* [mapserver-users] Point query from Mapserver raster
>
>
>
> Hi,
>
> Now that I have my WMS and WCS servers working well (thanks, list!!), I
> have one more thing I would like to figure out how to do.
>
>
>
> I want to do point queries on [Lat,Lon] points for their elevation from
> the terrain layer I have.
>
>
>
> I have done some searching and come across various ideas such as Raster
> Query (https://mapserver.org/input/raster.html#raster-query) and a query
> template  (
> https://gis.stackexchange.com/questions/167239/mapserver-raster-picking-elevation-data)
> but haven't found enough information for either to implement it.
>
>
>
> I came up with a solution that works fine, but might be considered as
> going "All Around the Barn"   What works is to add an ASCII output format
> to my map file that serves terrain like this:
>
>
>
> OUTPUTFORMAT
>
>   NAME XYZ
>
>   DRIVER "GDAL/XYZ"
>
>   MIMETYPE "text/plain"
>
>   IMAGEMODE FLOAT32
>
>   EXTENSION "txt"
>
> END
>
>
>
> and then use GetCoverage on a small rectangle whose lower-left corner
>
> is the point whose elevation I want:
>
>
>
>
> http://localhost:8080/wcs?SERVICE=WCS=2.0.1=GetCoverage=SRTM_3_arc-second_grid=XYZ=Lat(42.948,42.958)=Lon(-122.086,-122.076)
>
>
>
> and then take the first line of the returned output file.
>
>
>
> What would Mapserver best practice be for a problem like this?
>
>
>
> Thanks very much,
>
>
>
> carl
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Point query from Mapserver raster

2021-11-01 Thread Carl Godkin
Hi Jukka,

Thank you for  your reply.  I will play around with WMS + GetFeatureInfo
and see if I can make that work.

I'm still pretty new to this stuff and WCS seemed the more natural service
for this.

Thanks,

carl


On Mon, Nov 1, 2021 at 12:58 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> The WMS GetFeatureInfo should work and the answer in gis.stackexhange
> seems to contain all the details that you need for making it to work.
>
> With WCS what you did is probably the best you can do with Mapserver. With
> some other servers you may get a single pixel output by using WCS slicing
> (subset=Long(-100)=Lat(22)) or trimming with lowerlimit=upperlimit
> (subset=Long(-100,-100)=Lat(22,22)) but Mapserver does not support
> either. See https://osgeo-org.atlassian.net/browse/GEOS-9553.
>
>
>
> I could not find a link to an answer by Stefan Meissl about why Mapserver
> does not support slicing but it was about dimensions. A raster image can be
> considered to be two dimensional even when it has only one pixel, but by
> the WCS standard each trim is removing one dimension. Slicing DEM with two
> axes must return a zero dimensional result and raster formats do not
> support that. I still think that subsets with lower=upper limits should
> works and return a single pixel output but that does not work with either
> Mapserver or Geoserver. See also
> https://www.mail-archive.com/search?l=mapserver-users%40lists.osgeo.org=subject:%22%5C%5Bmapserver%5C-users%5C%5D+WCS+GetCoverage+request+one++by+one+pixel%22=newest=1
>
>
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* lauantai 30. lokakuuta 2021 2.10
> *Vastaanottaja:* mapserver-users@lists.osgeo.org
> *Aihe:* [mapserver-users] Point query from Mapserver raster
>
>
>
> Hi,
>
> Now that I have my WMS and WCS servers working well (thanks, list!!), I
> have one more thing I would like to figure out how to do.
>
>
>
> I want to do point queries on [Lat,Lon] points for their elevation from
> the terrain layer I have.
>
>
>
> I have done some searching and come across various ideas such as Raster
> Query (https://mapserver.org/input/raster.html#raster-query) and a query
> template  (
> https://gis.stackexchange.com/questions/167239/mapserver-raster-picking-elevation-data)
> but haven't found enough information for either to implement it.
>
>
>
> I came up with a solution that works fine, but might be considered as
> going "All Around the Barn"   What works is to add an ASCII output format
> to my map file that serves terrain like this:
>
>
>
> OUTPUTFORMAT
>
>   NAME XYZ
>
>   DRIVER "GDAL/XYZ"
>
>   MIMETYPE "text/plain"
>
>   IMAGEMODE FLOAT32
>
>   EXTENSION "txt"
>
> END
>
>
>
> and then use GetCoverage on a small rectangle whose lower-left corner
>
> is the point whose elevation I want:
>
>
>
>
> http://localhost:8080/wcs?SERVICE=WCS=2.0.1=GetCoverage=SRTM_3_arc-second_grid=XYZ=Lat(42.948,42.958)=Lon(-122.086,-122.076)
>
>
>
> and then take the first line of the returned output file.
>
>
>
> What would Mapserver best practice be for a problem like this?
>
>
>
> Thanks very much,
>
>
>
> carl
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Getting started with mapcache for WMTS...

2021-10-25 Thread Carl Godkin
Thanks for the suggestion, Scott.  I think the seeder is optional, right?

Anyway, I ended up figuring out that my  was wrong in a couple of
ways in mapcache.xml.  I misunderstood the
  parameters.  Now I have this:

   
 
 
image/png
FAA_Sectional_Charts
EPSG:3857
 
  
  
 http://localhost:8080/wms
  
   

I wrote a tiny little leaflet test and, after making every possible
mistake, finally
got it all to work so I'm all set. Thanks,

carl


On Mon, Oct 25, 2021 at 3:24 PM Scott  wrote:

> Try using mapcache seeder. That will create some cached images to work
> with. It will also test your mapcache config:
>
> https://mapserver.org/mapcache/seed.html
>
> How you use those tiles is a whole different subject.
>
>
>
> On 10/25/21 2:54 PM, Carl Godkin wrote:
> > Hi again,
> >
> > Is there a way to search through the mapserver-users mailing list
> > archive except month-by-month?  If so, I can't find it.  (I usually use
> > my Gmail archives for GDAL and PROJ since I've subscribed forever to
> > those but I'm a mapserver newbie.)  Anyway...
> >
> > I am trying to configure mapcache to serve from my (local and AFAICT
> > fully working) WMS server on my MS4W 4.0.5 installation.  I am following
> > the  directions at https://mapserver.org/mapcache/index.html
> > <https://mapserver.org/mapcache/index.html> as well as the steps listed
> > from the local MS4W page (#mapcache-apache-module).
> >
> > I think I understand the basic principles and have added a new source
> > that looks like this:
> >
> > 
> > 
> > 
> > image/geotiff
> > FAA_Sectional_Charts
> > TRUE
> > EPSG:4326
> > -125,24,-61,49
> > 
> > 
> > 
> > http://localhost:8080/wms <http://localhost:8080/wms>
> > 
> > 
> >
> > and a new tileset that looks like this:
> >
> > 
> > faa
> > disk
> > WGS84
> > PNG
> > 5 5
> > 10
> > 3600
> > 
> > (This is the same as the "test" tileset with a different source.)
> >
> > But how do I test this? The query
> >
> >
> http://localhost:8080/mapcache/wmts?service=wmts=getcapabilities=1.0.0
> > <
> http://localhost:8080/mapcache/wmts?service=wmts=getcapabilities=1.0.0
> >
> >
> > lists my new source as a layer. The docs say
> >
> >  5.
> >
> > Test your MapCache configuration by following steps in the
> > associated MapCache testing docs
> > <
> https://mapserver.org/mapcache/install.html#test-your-mapcache-module>
> >
> > but that seems to be about testing the mapcache/demo.  I don't see how
> > to add something to the mapcache/demo if that's possible.  What am I
> > overlooking?
> >
> > Thanks a lot,
> > carl
> >
> >
> >
> >
> >
> >
> > ___
> > MapServer-users mailing list
> > MapServer-users@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Getting started with mapcache for WMTS...

2021-10-25 Thread Carl Godkin
Hi again,

Is there a way to search through the mapserver-users mailing list archive
except month-by-month?  If so, I can't find it.  (I usually use my Gmail
archives for GDAL and PROJ since I've subscribed forever to those but I'm a
mapserver newbie.)  Anyway...

I am trying to configure mapcache to serve from my (local and AFAICT fully
working) WMS server on my MS4W 4.0.5 installation.  I am following the
directions at https://mapserver.org/mapcache/index.html as well as the
steps listed from the local MS4W page (#mapcache-apache-module).

I think I understand the basic principles and have added a new source that
looks like this:

   
  
 
image/geotiff
FAA_Sectional_Charts
TRUE
EPSG:4326
-125,24,-61,49
 
  
  
 http://localhost:8080/wms
  
   

and a new tileset that looks like this:

   
  faa
  disk
  WGS84
  PNG
  5 5
  10
  3600
   
(This is the same as the "test" tileset with a different source.)

But how do I test this? The query

http://localhost:8080/mapcache/wmts?service=wmts=getcapabilities=1.0.0

lists my new source as a layer.  The docs say

   1.

   Test your MapCache configuration by following steps in the
associated MapCache
   testing docs
   

but that seems to be about testing the mapcache/demo.  I don't see how to
add something to the mapcache/demo if that's possible.  What am I
overlooking?

Thanks a lot,
carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] WCS Tile index question

2021-10-20 Thread Carl Godkin
Thanks again; I had messed up the gdaltindex paths so (as the debug log
told me), mapserver couldn't find the .hgt files.

I just fixed that and I'm thrilled to report I've got a WCS serving terrain
now.

Thanks so much!!
carl

On Wed, Oct 20, 2021 at 3:55 PM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> I was just about to suggest to use DEBUG. GDAL does not use 
> “wcs_native_format”,
> it is used for setting what will be written into DescribeCoverage.
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* Carl Godkin 
> *Lähetetty:* torstai 21. lokakuuta 2021 1.50
> *Vastaanottaja:* Rahkonen Jukka (MML)  >
> *Aihe:* Re: [mapserver-users] WCS Tile index question
>
>
>
> Sorry, right after I sent that last reply to the list, I thought of
> turning up the DEBUG value in the mapfile to 5 and now I see it's not
> finding my .hgt files for some reason.
>
>
>
> I will dig into this; maybe mapserver + GDAL don't actually needs
> wcs_native_format.
>
>
>
> More later to the list if I sort this out.  I really appreciate the help
> you and Jeff and others on the list have given me!
>
>
>
> carl
>
>
>
> On Tue, Oct 19, 2021 at 5:37 PM Rahkonen Jukka (MML) <
> jukka.rahko...@maanmittauslaitos.fi> wrote:
>
> Hi,
>
>
>
> Here is more accurate documentation but only in the text
> https://www.mapserver.org/ogc/wcs_server.html
>
>
>
> “The convention is that once (wcs|ows)_extent and one of (wcs|ows)_size
> and (wcs|ows)_resolution is set in the layer metadata, all the coverage
> specific metadata will be retrieved from there. Otherwise the source image
> is queried via GDAL, if possible.”
>
>
>
> It seems that only wcs_extent is documented in the list of metadata
> elements but this is what they do:
>
>- wcs_extent defines the bounding box or your coverage -> that will go
>into DescribeCoverage
>- wcs_size is the size of the coverage as pixels -> pixel size can be
>computed by extent and size
>- wcs_resolution tells the pixel size explicitly -> size of the
>coverage in pixels can be computed
>
>
>
> We have in the LAYER-METADATA:
>
> "wcs_resolution" "0.5 0.5"
>
> "wcs_extent"  "19970 6597278 749676 7785300"
>
>
>
> That should be enough and Describe Coverage will have correct limits,
> origin, and offset vectors in RectifiedGrid.
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* keskiviikko 20. lokakuuta 2021 1.17
> *Vastaanottaja:* mapserver-users@lists.osgeo.org
> *Aihe:* [mapserver-users] WCS Tile index question
>
>
>
> Hi again,
>
>
>
> I am working with Mapserver trying to set up a WCS layer based on a large
> collection of SRTM .hgt files.
>
>
>
> Since I have many input files instead of a single file, I want to use a
> tile index.  I know how to make and use a tile index for WMS, but there's a
> twist for WCS that I don't understand.
>
>
>
> According to this section of the docs:
>
>
>  
> https://mapserver.org/optimization/tileindex.html?highlight=wcs_resolution#note-for-wcs-layers
>
> <https://mapserver.org/optimization/tileindex.html?highlight=wcs_resolution#note-for-wcs-layers>
>
>
>
> I need to set “wcs_extent”, “wcs_size”, and “wcs_resolution” but I don't
> see where they are defined or documented.
>
>
>
> Can you point me to documentation?  The WCS Use Cases page gives some
> hints so I think I understand wcs_extent (though it's "ows_extent" in some
> examples there so I guess these are interchangeable?)
>
>
>
> How are the others defined?
>
>
>
> Thank you for your help,
>
> carl
>
>
>
>
>
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] WCS Tile index question

2021-10-20 Thread Carl Godkin
Hi again Jukka,

Thanks for the speedy response.  I now think that I have the resolution and
extent correct with these.  (I was getting various errors trying other
things but this
set seems okay for GetCoverage, GetCapabilities and DescribeCoverage):

"ows_extent" "-125 24 -66 50"
"wcs_resolution" "0.000833 0.000833"

I actually retrieve a correctly located GeoTIFF (yay!!) out with this query
for instance:

http://localhost:8080/wcs?service=WCS=2.0.1; request=GetCoverage&
coverageid=SRTM_3_arc-second_grid& format=geotiff_16&
subset=Lat(43.256274,43.721318)& subset=Long(-112.357549,-111.719135)

but it's all zeros.

My data files are all native SRTM ".hgt" files. (And yes, I did "gdalinfo
-stats" on one tile for the above query and there are good values.)

I could gdal_translate them all to GeoTIFF, but since GDAL supports HGT
files I hoped I could use them as is.

I have tried everything I can think of for the "wcs_native_format" metadata:

  "wcs_native_format" "application/srtmhgt"

and application/hgt, image/hgt, srtmhgt, etc. I don't see errors in
mapserver log though no matter what I try. Is this my problem?

What do you suggest?

Thanks again,
carl









On Wed, Oct 20, 2021 at 3:23 PM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

>
>
> Lähettäjä: MapServer-users 
> Puolesta Carl Godkin
>
>
>
> >> On Tue, Oct 19, 2021 at 5:37 PM Rahkonen Jukka (MML)  jukka.rahko...@maanmittauslaitos.fi> wrote:
> >> Hi,
>
> >> Here is more accurate documentation but only in the text
> >> https://www.mapserver.org/ogc/wcs_server.html
>
> >> “The convention is that once (wcs|ows)_extent and one of
> >> (wcs|ows)_size and (wcs|ows)_resolution is set in the layer metadata,
> all the coverage specific metadata will be retrieved from there. Otherwise
> the source image is queried via GDAL, if possible.”
>
> >> It seems that only wcs_extent is documented in the list of metadata
> elements but this is what they do:
> >> • wcs_extent defines the bounding box or your coverage -> that will
> >> go into DescribeCoverage • wcs_size is the size of the coverage as
> >> pixels -> pixel size can be computed by extent and size •
> >> wcs_resolution tells the pixel size explicitly -> size of the
> >> coverage in pixels can be computed
>
> > Thanks a lot, Jukka.  That all makes some sense as far as it goes, but
> > I'm still not clear on a few details. I have this range of data: 24N to
> 50N and 125W to 66W which is 26 degrees by 59 degrees.
>
> >  Since the SRTM data has 3 arc-second spacing, that's 1200 pixels per
> > degree plus one for the extra edge so I have tried a number of things
> without success.
>
> What fails? Don't you get anything into DescribeCoverage or is all that
> you get wrong?
>
> > 1. Is wcs_size the size FULL range of the tiles that I have?  And what
> is the order?
>
> You do not need to bother about the size if you set the resolution, but
> yes, it is the full range of the coverage. See this
> https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?service=WCS=DescribeCoverage=2.0.1=ortokuva__ortokuva
>
> The size is converted into the pixel space of the coverage
> gml:GridEnvelope>
> 0 0
> 1348356 2316499
> 
> I would say that the order is left-to-right - down-to-up but I fear that
> by the GML standard it can be something else. You can read about rectified
> grid from the OpenGIS Geography Markup Language (GML) Encoding Standard
> 3.2.1. I have never understood it but there are some images which may
> clarify this: "rectified grid: grid for which there is an affine
> transformation between the grid coordinates and the coordinates of an
> external coordinate reference system"
>
> > 2. Again, what is the order for wcs_resolution?  Are the units degrees
> since the coordinate system of the original data is EPSG:4326?
> With Mapserver the order is easting/longitude - northing/latitude
>
> > I've tried all of these, one at a time, and get various errors.  (1 /
> > 1200 = 0.0008...)
> What errors?
>
> >#"wcs_resolution" "0.0008 0.0008"
> Looks right
> >#"wcs_size" "70801 31201"
> Looks right if you prefer to give size instead of resolution
> >"wcs_size" "31201 70801"
> This is wrong.
>
> > In case it's helpful, here's my LAYER definition (with probably extra
> things I've tried based on my searching and trial & error):
>
> LAYER
>   NAME SRTM_3_arc-second_gri

Re: [mapserver-users] WCS Tile index question

2021-10-20 Thread Carl Godkin
On Tue, Oct 19, 2021 at 5:37 PM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> Here is more accurate documentation but only in the text
> https://www.mapserver.org/ogc/wcs_server.html
>
>
>
> “The convention is that once (wcs|ows)_extent and one of (wcs|ows)_size
> and (wcs|ows)_resolution is set in the layer metadata, all the coverage
> specific metadata will be retrieved from there. Otherwise the source image
> is queried via GDAL, if possible.”
>
>
>
> It seems that only wcs_extent is documented in the list of metadata
> elements but this is what they do:
>
>- wcs_extent defines the bounding box or your coverage -> that will go
>into DescribeCoverage
>- wcs_size is the size of the coverage as pixels -> pixel size can be
>computed by extent and size
>- wcs_resolution tells the pixel size explicitly -> size of the
>coverage in pixels can be computed
>
> Thanks a lot, Jukka.  That all makes some sense as far as it goes, but I'm
still not clear on a few details.  I have this range of data: 24N to 50N
and 125W to 66W which is 26 degrees by 59 degrees.

Since the SRTM data has 3 arc-second spacing, that's 1200 pixels per degree
plus one for the extra edge so I have tried a number of things without
success.

1. Is wcs_size the size FULL range of the tiles that I have?  And what is
the order?
2. Again, what is the order for wcs_resolution?  Are the units degrees
since the coordinate system of the original data is EPSG:4326?

I've tried all of these, one at a time, and get various errors.  (1 / 1200
= 0.0008...)

#"wcs_resolution" "0.0008 0.0008"
#"wcs_size" "70801 31201"
"wcs_size" "31201 70801"

In case it's helpful, here's my LAYER definition (with probably extra
things I've tried based on my searching and trial & error):

LAYER
  NAME SRTM_3_arc-second_grid
  METADATA
"wcs_label"   "SRTM - 3 arc-second grid"  ### required
"wcs_rangeset_name"   "Range 1"  ### required to support
DescribeCoverage request
"wcs_rangeset_label"  "Lower 48" ### required to support
DescribeCoverage request
"ows_extent" "-125 24 -66 50"
#"wcs_resolution" "0.0008 0.0008" # 1/1200 for 3" spacing?
#"wcs_size" "70801 31201" # Not sure of order
"wcs_size" "31201 70801"
"wcs_bandcount" "1"
"wcs_native_format" "SRTMHGT" # What should this be? I can't find
examples...
"wcs_srs" "EPSG:4326"
  END

  TYPE RASTER ### required
  STATUS ON
  TILEINDEX "../srtm_3_hgt/srtm_3_hgt-index.shp" # Path is relative to
SHAPEPATH
  TILEITEM "Location"
  PROJECTION
"init=epsg:4326"
  END
END
I feel like I must be close. Thanks a lot for any further pointers,

carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] WCS Tile index question

2021-10-19 Thread Carl Godkin
Hi again,

I am working with Mapserver trying to set up a WCS layer based on a large
collection of SRTM .hgt files.

Since I have many input files instead of a single file, I want to use a
tile index.  I know how to make and use a tile index for WMS, but there's a
twist for WCS that I don't understand.

According to this section of the docs:
 
https://mapserver.org/optimization/tileindex.html?highlight=wcs_resolution#note-for-wcs-layers


I need to set “wcs_extent”, “wcs_size”, and “wcs_resolution” but I don't
see where they are defined or documented.

Can you point me to documentation?  The WCS Use Cases page gives some hints
so I think I understand wcs_extent (though it's "ows_extent" in some
examples there so I guess these are interchangeable?)

How are the others defined?

Thank you for your help,
carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Getting started with WCS on mapserver...

2021-10-18 Thread Carl Godkin
Hi Jukka,

Thank you for the explanation.  I will see about using DescribeCoverage
instead.  I just tried it with my server and the gml:Envelope is indeed
filled in properly and I should be able to use it.

carl

On Mon, Oct 18, 2021 at 11:49 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> The wgs84-BoundingBox is an optional element in the CoverageSummary by the
> WCS 2.0.1 standard. There may be no way to configure Mapserver to add that
> information into GetCapabilities. You must read extents coverage by
> coverage with DescribeCoverage requests. But the boundedBy in that place is
> using the native CRS of the coverage like here:
>
>
>
> 
>
> http://www.opengis.net/def/crs/EPSG/0/3067;
> axisLabels="x y" uomLabels="m m" srsDimension="2">
>
> 212000 6762000
>
> 218000 6768000
>
> 
>
> 
>
>
>
> The extent that appears in DescribeCoverage can be configured with the
> “wcs_extent” metadata if it does not get generated automatically right.
> Having wgs84-BoundingBox in CoverageSummary could be useful for WCS clients
> but even the GetCapabilities example in the WCS Core 2.0.1 standard does
> not contain it.
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* MapServer-users  
> *Puolesta
> *Carl Godkin
> *Lähetetty:* maanantai 18. lokakuuta 2021 21.24
> *Vastaanottaja:* mapserver-users@lists.osgeo.org
> *Aihe:* [mapserver-users] Getting started with WCS on mapserver...
>
>
>
> Hi,
>
>
>
> A week and a half ago I asked about using Mapserver +WMS to serve
> elevation data since I was following a tutorial that discussed WMS.
>
>
>
> In one of the replies I received, Jeff suggested that I actually wanted
> WCS for my use case which was a forehead slap + d'oh! moment for me.  Of
> course I do!
>
>
>
> Anyway, I have followed the Mapserver WCS docs and everything seems to
> work well.
>
>
>
> However, I have one question that may be kind of niche or will perhaps
> betray my overall ignorance.
>
>
>
> A while ago I wrote a WCS client for another project and it expects WCS
> version 2.0 requests.
>
>
>
> The map file that I made up (based closely on the one in the docs:
> https://mapserver.org/ogc/wcs_server.html#example-wcs-server-mapfile )
> seems to work fine for WCS 1.0, 1.1, and 2.0.  However, I don't seem to get
> a bounding box from GetCapabilities in the CoverageSummary from my 2.0
> requests whereas I certainly do from the 1.1 request:
>
>
>
> I get this from VERSION=1.1.0:
>
>
>
> 
>
> 
>
> bathymetry
>
> 
>
> 
>
> -180 -90
>
> 180 90
>
> 
>
> urn:ogc:def:crs:EPSG::4326
>
> image/tiff
>
> bathymetry
>
> 
>
> 
>
>
>
> whereas I get just this from VERSION=2.0.1:
>
>
>
> 
>
> 
>
> bathymetry
>
> RectifiedGridCoverage
>
> 
>
> 
>
>
>
> Is there something I can add to my WCS map file to get the 
> "ows:WGS84BoundingBox"
> element returned in my GetVersion?  I believe I was working with Geoserver
> sources when I wrote that client but I would really like to get the
> geographic extents.
>
>
>
> Thank you very much for the great documentation!
>
>
>
> carl
>
>
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Getting started with WCS on mapserver...

2021-10-18 Thread Carl Godkin
Hi,

A week and a half ago I asked about using Mapserver +WMS to serve elevation
data since I was following a tutorial that discussed WMS.

In one of the replies I received, Jeff suggested that I actually wanted WCS
for my use case which was a forehead slap + d'oh! moment for me.  Of course
I do!

Anyway, I have followed the Mapserver WCS docs and everything seems to work
well.

However, I have one question that may be kind of niche or will perhaps
betray my overall ignorance.

A while ago I wrote a WCS client for another project and it expects WCS
version 2.0 requests.

The map file that I made up (based closely on the one in the docs:
https://mapserver.org/ogc/wcs_server.html#example-wcs-server-mapfile )
seems to work fine for WCS 1.0, 1.1, and 2.0.  However, I don't seem to get
a bounding box from GetCapabilities in the CoverageSummary from my 2.0
requests whereas I certainly do from the 1.1 request:

I get this from VERSION=1.1.0:



bathymetry


-180 -90
180 90

urn:ogc:def:crs:EPSG::4326
image/tiff
bathymetry



whereas I get just this from VERSION=2.0.1:



bathymetry
RectifiedGridCoverage



Is there something I can add to my WCS map file to get the
"ows:WGS84BoundingBox"
element returned in my GetVersion?  I believe I was working with Geoserver
sources when I wrote that client but I would really like to get the
geographic extents.

Thank you very much for the great documentation!

carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapserver + WMS

2021-10-11 Thread Carl Godkin
Hi Jeff,

Thank you very much for the detailed response.  When I run the commands you
provided, everything matches and the output GeoTIFF file definitely has the
type "Type=Int16."

I was originally asking why I didn't see that type when querying the server
with the sub-datasets returned by this command

> gdalinfo "WMS:http://localhost:8080//elev;

but I'm probably just coloring outside the lines of what WMS is meant to
support.

I think that the next thing I will do is use WCS for this instead.  I
confess that I went with WMS since I'm more familiar with it.  I expected a
single-band 16-bit "image" to act like a 2D grid which is what happens when
I import "BIL" files or other single-band images.

Thanks for stepping me through this and pointing me at WCS.

carl


On Mon, Oct 11, 2021 at 11:35 AM Jeff McKenna 
wrote:

> Hi Carl,
>
> First, welcome to the MapServer community!
>
> Thanks for the detailed question, and pointing to the source data, this
> always helps to give a proper answer.
>
> You've done well and are very close.  Here are some points to consider:
>
> - the OGC specification for serving raw raster data is actually WCS
> (which MapServer does well, see https://mapserver.org/ogc/wcs_server.html
> )
>
> - but you're right that a cool trick is to use the (more) popular WMS
> specification and set an OUTPUTFORMAT in your server's mapfile, to
> generate a GeoTIFF through a WMS GetMap request.
>
> - I see that you've already setup an OUTPUTFORMAT such as:
>
> OUTPUTFORMAT
>NAME "GEOTIFF_16"
>DRIVER "GDAL/GTiff"
>MIMETYPE "image/tiff"
>IMAGEMODE INT16
>EXTENSION "tif"
> END
>
> - now the trick is to call that specific outputformat.  I recommend
> always testing this at the commandline first, with shp2img (which will
> be renamed to 'map2img' shortly, for the MapServer 8.0 release).  It
> takes a mapfile and generates an output (or gives exact error).
>
> - since you are using MS4W, just open a CMD window and cd into /ms4w.
> Then execute 'setenv.bat' to set necessary paths.  Then, in that same
> windows, cd to where your mapfile is, and execute the following (notice
> the "-i" switch, which requests the named outputformat set in the mapfile)
> :
>
>shp2img -m local.map -o ttt16.tif -map_debug 3 -i GEOTIFF_16
>
> - that command should return a draw speed for each layer, and generate
> your 16-bit GeoTIFF.  And look closely at that response, the first words
> will be something like:
>
> rendering using outputformat named GEOTIFF_16 (GDAL/GTiff)
>
> Great! That's what we want.
>
> - once you're satisfied, now we can turn to WMS requests.  But always
> first start with removing any "WARNING" messages in your GetCapabilities
> request, and then also verifying that the  section of that
> response includes a listed "image/tiff" format option.  (example
> GetCapabilities request) :
>
>
>
> http://127.0.0.1/cgi-bin/mapserv.exe?map=/ms4w/apps/ticket-wms-gebco-outputformat/local.map=WMS=1.3.0=GetCapabilities
>
> - once you're happy with the GetCapabilities response, then you can try
> a GetMap request, that includes "=image/tiff"
>
>
>
>
> http://127.0.0.1/cgi-bin/mapserv.exe?map=/ms4w/apps/ticket-wms-gebco-outputformat/local.map=WMS=1.3.0=GetMap=-90,-180,90,180=EPSG:4326=346=173=gebco==image/tiff=96_RESOLUTION=96_OPTIONS=dpi:96=TRUE
>
> - or you can stay right there at your commandline, and make that GetMap
> request there with the "mapserv -nh QUERY_STRING="" trick, and pipe that
> to a new image file, such as:
>
>mapserv -nh
> QUERY_STRING="map=/ms4w/apps/ticket-wms-gebco-outputformat/local.map=WMS=1.3.0=GetMap=-90,-180,90,180=EPSG:4326=346=173=gebco==image/tiff=96_RESOLUTION=96_OPTIONS=dpi:96=TRUE"
>
>  > getmap.tif
>
> Hope that helps.
>
> Also thanks for the positive feedback on MS4W, its goal is to serve big
> data fast for organizations, on enterprise Windows servers, and it
> sounds like it has met your needs well.  Look for a big MS4W release soon
> ;)
>
> And a happy (Canadian) Thanksgiving holiday to you.
>
> -jeff
>
>
>
> --
> Jeff McKenna
> GatewayGeo: Developers of MS4W, MapServer Consulting and Training
> co-founder of FOSS4G
> http://gatewaygeo.com/
>
>
>
> On 2021-10-07 8:12 p.m., Carl Godkin wrote:
> > Hi,
> >
> > I'm new to mapserver but fairly experienced with GDAL.  I hope that
> > someone can explain where I've gone wrong with setting up WMS.
> >
> > I followed the instructions here
> > [https://worldwind.earth/elevation-server.html
> > <https://worldwind.earth/ele

[mapserver-users] Mapserver + WMS

2021-10-07 Thread Carl Godkin
Hi,

I'm new to mapserver but fairly experienced with GDAL.  I hope that someone
can explain where I've gone wrong with setting up WMS.

I followed the instructions here [
https://worldwind.earth/elevation-server.html] almost exactly to set up a
WMS server and it sort of works.  (I am using MS4W actually, so I didn't
install Apache & Mapserver as that page described and of course I made a
few other adaptations for Windows.)

I downloaded the GEBCO tiles from here [
https://www.gebco.net/data_and_products/gridded_bathymetry_data/] without
any problems.

What I don't understand is that while the GEBCO GeoTIFF files that I am
using have one band that gdalinfo describes as

 Band 1 Block=512x512 Type=Int16, ColorInterp=Gray

when I look at the WMS bands using gdalinfo, I see three byte-sized bands:

Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Green
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Blue

I'd really like to get 16-bit integer elevations from my WMS server but I
don't know why this didn't just happen or how I mis-configured things to
make it not happen.

I know these are not complete details, but rather than write a novel for my
first post here, I'm hoping someone can suggest where the problem might be
or suggest some further documentation to read.

Thanks very much,
carl
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users