[mapserver-users] Point query from Mapserver raster

Carl Godkin cgodkin at gmail.com
Mon Nov 1 06:50:41 PDT 2021


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.rahkonen at 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)&subset=Lat(22)) or trimming with lowerlimit=upperlimit
> (subset=Long(-100,-100)&subset=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&q=subject:%22%5C%5Bmapserver%5C-users%5C%5D+WCS+GetCoverage+request+one++by+one+pixel%22&o=newest&f=1
>
>
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
> *Lähettäjä:* MapServer-users <mapserver-users-bounces at lists.osgeo.org> *Puolesta
> *Carl Godkin
> *Lähetetty:* lauantai 30. lokakuuta 2021 2.10
> *Vastaanottaja:* mapserver-users at 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&VERSION=2.0.1&REQUEST=GetCoverage&coverageid=SRTM_3_arc-second_grid&format=XYZ&subset=Lat(42.948,42.958)&subset=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
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20211101/9af23df7/attachment-0001.html>


More information about the MapServer-users mailing list