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
>
> 
>
>
>
> 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 Rahkonen Jukka (MML)
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) 
mailto: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 
mailto:mapserver-users-boun...@lists.osgeo.org>>
 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


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_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"
> 

Re: [mapserver-users] WCS Tile index question

2021-10-20 Thread Rahkonen Jukka (MML)


Lähettäjä: MapServer-users  Puolesta 
Carl Godkin



>> On Tue, Oct 19, 2021 at 5:37 PM Rahkonen Jukka (MML) 
>>  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
 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_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...

It is supposed to be the native format of the layer data, format that 
theoretically requires no processing, just selecting the right pixels. In 
practice the format that you users get by default with GetCoverage. It goes 
into DescribeCoverage about this way:
image/tiff 
and it is documented in the WCS 2.0.1 Core standard:
"4.7 Native Format
encoding format where, in a GetCoverage request, the range set values can be 
obtained unaltered"

        "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,

-Jukka-

> 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
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