Re: [mapserver-users] WCS GetCoverage request one by one pixel

2020-05-11 Thread Rahkonen Jukka (MML)
Hi,

I verified the error and I am pretty sure that subsetting with min=max has been 
working for me couple of years ago with some Mapserver version.

This sends a GeoTIFF:
http://localhost:8060/cgi-bin/mapserv.exe?map=c:\ms4w_data\raster_test.map=WCS=2.0.1=GetCoverage=natural_earth=long(27,28)=lat(62,63)

This sends an error:
http://localhost:8060/cgi-bin/mapserv.exe?map=c:\ms4w_data\raster_test.map=WCS=2.0.1=GetCoverage=natural_earth=long(27,27)=lat(62,62)
msImageCreate(): Image handling error. Attempt to allocate raw image failed, 
out of memory.

I believe that 1x1 pixel image is expected because WCS 2.0.1 standard defines 
that the request is OK.

"Then, for the trim bounds trimLow and trimHigh the following
shall hold: L <= trimLow <= trimHigh <= H"

Here is my MS4W mapfile for the Natural Earth raster 
https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/raster/NE1_50M_SR_W.zip<https://www.naturalearthdata.com/http/www.naturalearthdata.com/download/50m/raster/NE1_50M_SR_W.zip>

MAP
  NAME ""
  STATUS ON
MAXSIZE 5000
CONFIG "MS_ERRORFILE" "c:\ms4w_data\test_error.txt"
#DEBUG 3
EXTENT -180 -90 180 90
  SIZE 600 600
  #SHAPEPATH "c:\ms4w\tmp\ms_tmp"
  IMAGECOLOR 255 255 255
  UNITS METERS
  WEB
#IMAGEPATH "c:\ms4w\tmp\ms_tmp"
#IMAGEURL "c:\ms4w\tmp\ms_tmp"
  METADATA
  "ows_enable_request" "*"
  "wms_srs""EPSG:4326"
  "ows_onlineresource"
"http://localhost:8060/cgi-bin/mapserv.exe?map=c:\ms4w_data\test.map;
  "wms_title""wms-test"
  "wcs_label"   "wcs-test" ### required
  "wcs_description" "wcs-test"
  "wcs_enable_request"   "*"
 END
  END
PROJECTION
"init=epsg:4326"
  END
  OUTPUTFORMAT
  NAME 'AGG_Q'
  MIMETYPE "image/png"  DRIVER "AGG/PNG"
  EXTENSION "png"
  IMAGEMODE RGB
  FORMATOPTION "QUANTIZE_FORCE=ON"
  FORMATOPTION "QUANTIZE_DITHER=OFF"
  FORMATOPTION "QUANTIZE_COLORS=256"
  END
OUTPUTFORMAT
  NAME GEOTIFF
  DRIVER "GDAL/GTiff"
  MIMETYPE "image/tiff"
  IMAGEMODE BYTE
  EXTENSION "tif"
END

LAYER
NAME "natural_earth"
TYPE RASTER
STATUS ON
DATA "c:\ms4w_data\ne_raster\NE1_50M_SR_W.tif"
PROJECTION
"init=epsg:4326"
END
METADATA
  "wms_title" "ne_raster"
  "wcs_title" "ne_raster"
END

END #layer
END #map


Lähettäjä: mapserver-users  Puolesta 
Even Rouault
Lähetetty: lauantai 9. toukokuuta 2020 21.41
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: Re: [mapserver-users] WCS GetCoverage request one by one pixel


Anton,



> I quickly skimmed the issue tracker on Github but could not find any issue

> causing this problem. Any thoughts on the cause of the problem are highly

> appreciated.



I believe this is a bug in MapServer due to a difference between pixel-center 
vs pixel-corner convention between WCS conventions and MapServer conventions, 
which must lead to an empty bounding box when the request is 1x1, and thus 
causing invalid resolution to be computed at some point (division by zero). 
This could presumably be fixed



Even



--

Spatialys - Geospatial professional services

http://www.spatialys.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] WCS GetCoverage request one by one pixel

2020-05-09 Thread Even Rouault
Anton,

> I quickly skimmed the issue tracker on Github but could not find any issue
> causing this problem. Any thoughts on the cause of the problem are highly
> appreciated.

I believe this is a bug in MapServer due to a difference between pixel-center 
vs 
pixel-corner convention between WCS conventions and MapServer conventions, 
which must lead to an empty bounding box when the request is 1x1, and thus 
causing invalid resolution to be computed at some point (division by zero). 
This 
could presumably be fixed

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] WCS GetCoverage request one by one pixel

2020-05-07 Thread Bakker, Anton
Hi Jukka,

I finally managed to check up on your suggestion. I set the RESAMPLE mode to 
NEAREST in the mapfile on a MapServer instance running locally on my machine. 
This results in the same response as setting the resampling method in the url 
(see my previous email) :

http://localhost:32788/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196396.75)=y(450031.75,450031.75)


http://www.opengis.net/ows/2.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; version="2.0.1" 
xml:lang="en-US" xsi:schemaLocation="http://www.opengis.net/ows/2.0 
https://geodata.nationaalgeoregister.nl/ows/2.0/owsExceptionReport.xsd">
  
msImageCreate(): Image handling error. Attempt to 
allocate raw image failed, out of memory.
  


Also all resampling methods result in the same response (tested by supplying 
through the query parameter in the url). When  I look in the logs I see that 
MapServer determines the dimensions of the request to be 0x0 pixels, causing 
the creation of the image to fail:

2020-05-06 17:38:11: (mod_fastcgi.c.421) FastCGI-stderr: Subset for X-axis 
found: x
2020-05-06 17:38:11: (mod_fastcgi.c.421) FastCGI-stderr: Subset for Y-axis 
found: y
2020-05-06 17:38:11: (mod_fastcgi.c.421) FastCGI-stderr: msWCSGetCoverage20(): 
Set parameters from originaldata. Width: 0, height: 0, cellsize: -nan, extent: 
-nan,-nan,-nan,-nan
2020-05-06 17:38:11: (mod_fastcgi.c.421) FastCGI-stderr: msImageCreate(): Image 
handling error. Attempt to allocate raw image failed, out of memory.

​I also quickly checked whether requesting a 1x1 subset works, but this fails 
by returning geotiff image of 1x1 pixel with a pixel size of "-135000,162500":
http://localhost:32788/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196397.25)=y(450031.75,450032.25)

However requesting an image of 2x2 pixels still works as expected:
http://localhost:32788/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196397.75)=y(450031.75,450032.75)

Kind regards,
Anton


From: Rahkonen Jukka (MML) 
mailto:jukka.rahko...@maanmittauslaitos.fi>>
Sent: Tuesday, April 7, 2020 5:49 PM
To: Bakker, Anton mailto:anton.bak...@kadaster.nl>>; 
mapserver-users@lists.osgeo.org 
mailto:mapserver-users@lists.osgeo.org>>
Subject: Re: WCS GetCoverage request one by one pixel


Hi Anton,



What I meant was to have a try by commenting out this line from your mapfile

PROCESSING "RESAMPLE=BILINEAR"



Actually it would be interesting to know what really happens if the 
interpolation/resampling method is configured in the mapfile and GetCoverage 
comes also with Interpolation parameter.



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

Re: [mapserver-users] WCS GetCoverage request one by one pixel

2020-04-07 Thread Bakker, Anton
Hi Jukka,

Thanks for your response; do you mean to set the default resampling method in 
the mapfile? Setting the resampling method in the WCS request does not work 
(for both GET and POST requests):

POST:

http://www.opengis.net/wcs/2.0
http://schemas.opengis.net/wcs/2.0/wcsAll.xsd;
  xmlns="http://www.opengis.net/wcs/2.0;
  xmlns:wcs="http://www.opengis.net/wcs/2.0;
  xmlns:wcscrs="http://www.opengis.net/wcs/crs/1.0;
  xmlns:scal="http://www.opengis.net/wcs/scaling/1.0;
  xmlns:int="http://www.opengis.net/wcs/interpolation/1.0;
  service="WCS"
  version="2.0.1">
ahn3_05m_dsm

x
196396.75
196396.75


y
450031.75
450031.75

image/tiff


NEAREST




GET:

https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196396.75)=y(450031.75,450031.75)=NEAREST

Both POST and GET request fail with the same error: "msImageCreate(): Image 
handling error. Attempt to allocate raw image failed, out of memory."

Cheers,
Anton


From: Rahkonen Jukka (MML) 
mailto:jukka.rahko...@maanmittauslaitos.fi>>
Sent: Monday, April 6, 2020 5:26 PM
To: Bakker, Anton mailto:anton.bak...@kadaster.nl>>; 
mapserver-users@lists.osgeo.org 
mailto:mapserver-users@lists.osgeo.org>>
Subject: Re: WCS GetCoverage request one by one pixel


Hi,



Could you have a try with the default resampling "nearest"? And then also with 
subset having lower limit equal to upper. Now it fails, I tried already.



https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196396.75)=y(450031.75,450031.75)



GetCoverage trim with equal low and high has at least worked in the past, see 
http://osgeo-org.1560.x6.nabble.com/Why-WCS-2-0-1-slice-is-not-supported-td5343277.html



It should be OK by the WCS standard because all intersected pixels should be 
included and in this case the intersection is a single pixel. But see also 
https://osgeo-org.atlassian.net/browse/GEOS-9553 and learn that Geoserver 
supports slicing but not trimming to one pixel.



-Jukka Rahkonen-


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

Re: [mapserver-users] WCS GetCoverage request one by one pixel

2020-04-07 Thread Rahkonen Jukka (MML)
Hi Anton,

What I meant was to have a try by commenting out this line from your mapfile
PROCESSING "RESAMPLE=BILINEAR"

Actually it would be interesting to know what really happens if the 
interpolation/resampling method is configured in the mapfile and GetCoverage 
comes also with Interpolation parameter.

-Jukka-

Lähettäjä: Bakker, Anton 
Lähetetty: tiistai 7. huhtikuuta 2020 18.40
Vastaanottaja: Rahkonen Jukka (MML) ; 
mapserver-users@lists.osgeo.org
Aihe: RE: WCS GetCoverage request one by one pixel

Hi Jukka,

Thanks for your response; do you mean to set the default resampling method in 
the mapfile? Setting the resampling method in the WCS request does not work 
(for both GET and POST requests):

POST:

http://www.opengis.net/wcs/2.0
http://schemas.opengis.net/wcs/2.0/wcsAll.xsd;
  xmlns="http://www.opengis.net/wcs/2.0;
  xmlns:wcs="http://www.opengis.net/wcs/2.0;
  xmlns:wcscrs="http://www.opengis.net/wcs/crs/1.0;
  xmlns:scal="http://www.opengis.net/wcs/scaling/1.0;
  xmlns:int="http://www.opengis.net/wcs/interpolation/1.0;
  service="WCS"
  version="2.0.1">
ahn3_05m_dsm

x
196396.75
196396.75


y
450031.75
450031.75

image/tiff


NEAREST




GET:

https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196396.75)=y(450031.75,450031.75)=NEAREST

Both POST and GET request fail with the same error: "msImageCreate(): Image 
handling error. Attempt to allocate raw image failed, out of memory."

Cheers,
Anton


From: Rahkonen Jukka (MML) 
mailto:jukka.rahko...@maanmittauslaitos.fi>>
Sent: Monday, April 6, 2020 5:26 PM
To: Bakker, Anton mailto:anton.bak...@kadaster.nl>>; 
mapserver-users@lists.osgeo.org 
mailto:mapserver-users@lists.osgeo.org>>
Subject: Re: WCS GetCoverage request one by one pixel


Hi,



Could you have a try with the default resampling "nearest"? And then also with 
subset having lower limit equal to upper. Now it fails, I tried already.



https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196396.75)=y(450031.75,450031.75)



GetCoverage trim with equal low and high has at least worked in the past, see 
http://osgeo-org.1560.x6.nabble.com/Why-WCS-2-0-1-slice-is-not-supported-td5343277.html



It should be OK by the WCS standard because all intersected pixels should be 
included and in this case the intersection is a single pixel. But see also 
https://osgeo-org.atlassian.net/browse/GEOS-9553 and learn that Geoserver 
supports slicing but not trimming to one pixel.



-Jukka Rahkonen-


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

Re: [mapserver-users] WCS GetCoverage request one by one pixel

2020-04-06 Thread Rahkonen Jukka (MML)
Hi,

Could you have a try with the default resampling "nearest"? And then also with 
subset having lower limit equal to upper. Now it fails, I tried already.

https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196396.75)=y(450031.75,450031.75)

GetCoverage trim with equal low and high has at least worked in the past, see 
http://osgeo-org.1560.x6.nabble.com/Why-WCS-2-0-1-slice-is-not-supported-td5343277.html

It should be OK by the WCS standard because all intersected pixels should be 
included and in this case the intersection is a single pixel. But see also 
https://osgeo-org.atlassian.net/browse/GEOS-9553 and learn that Geoserver 
supports slicing but not trimming to one pixel.

-Jukka Rahkonen-

Lähettäjä: mapserver-users  Puolesta 
Bakker, Anton
Lähetetty: maanantai 6. huhtikuuta 2020 16.00
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] WCS GetCoverage request one by one pixel

Hi all,

I am running into a problem when sending HTTP requests to a MapServer backed 
WCS service.  I am trying to request a GeoTIFF of exactly 1 by 1 pixel, however 
this request fails by responding with a huge pixel (here is the 
describeCoverage request of the coverage requested):

https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196397.25)=y(450031.75,450032.25)

When I modify the request to cover an area of 2X2 pixels, the response turns 
out fine:

https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196397.75)=y(450031.75,450032.75)

See the screenshots hosted on imgur; (https://imgur.com/a/8IBGs3G (first 
screenshot is the erronous response of the request with the 1X1 extent, second 
screenshot is the result of the 2X2 request).

The MapServer version we are running is 7.4.3. Here is an excerpt of the 
mapfile that is used to configure the WCS service:

LAYER
NAME ahn3_05m_dsm
METADATA
  "wcs_srs"  "EPSG:28992"
  "wcs_label"   "ahn3_05m_dsm"
  "wcs_rangeset_name"   "ahn3_05m_dsm"
  "wcs_rangeset_label"  "ahn3_05m_dsm"
  "wcs_extent"  "1 25 356250 618750"
  "wcs_resolution"  "0.5 0.5"
  "wcs_formats" "GEOTIFF_FLOAT32 GEOTIFF_BYTE GEOTIFF_INT16 
GEOTIFF_RGB"
  "wcs_imagemode"   "FLOAT32"
  "wcs_bandcount"   "1"
END
TYPE RASTER
DUMP TRUE
STATUS ON
DATA /srv/data/ahn3_05m_dsm/ahn3_05m_dsm.vrt
PROCESSING "RESAMPLE=BILINEAR"
PROJECTION
  "init=epsg:28992"
END
END

I quickly skimmed the issue tracker on Github but could not find any issue 
causing this problem. Any thoughts on the cause of the problem are highly 
appreciated.

Kind regards,

Anton Bakker, Software Engineer
Kadaster / Geo- en Vastgoedinformatie en Advies / PDOK
tel. 06 - 29 737 351
anton.bak...@kadaster.nl<mailto:anton.bak...@kadaster.nl>
www.kadaster.nl<http://www.kadaster.nl>



Disclaimer:
De inhoud van dit bericht is uitsluitend bestemd voor geadresseerde.
Gebruik van de inhoud van dit bericht door anderen zonder toestemming van het 
Kadaster
is onrechtmatig. Mocht dit bericht ten onrechte bij u terecht komen, dan 
verzoeken wij u
dit direct te melden aan de verzender en het bericht te vernietigen.
Aan de inhoud van dit bericht kunnen geen rechten worden ontleend.

Disclaimer:
The content of this message is meant to be received by the addressee only.
Use of the content of this message by anyone other than the addressee without 
the consent
of the Kadaster is unlawful. If you have received this message, but are not the 
addressee,
please contact the sender immediately and destroy the message.
No rights can be derived from the content of this message.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] WCS GetCoverage request one by one pixel

2020-04-06 Thread Bakker, Anton
Hi all,

I am running into a problem when sending HTTP requests to a MapServer backed 
WCS service.  I am trying to request a GeoTIFF of exactly 1 by 1 pixel, however 
this request fails by responding with a huge pixel (here is the 
describeCoverage request of the coverage requested):

https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196397.25)=y(450031.75,450032.25)

When I modify the request to cover an area of 2X2 pixels, the response turns 
out fine:

https://geodata.nationaalgeoregister.nl/ahn3/wcs?service=WCS=GetCoverage=2.0.1=ahn3_05m_dsm=image/tiff=x(196396.75,196397.75)=y(450031.75,450032.75)

See the screenshots hosted on imgur; (https://imgur.com/a/8IBGs3G (first 
screenshot is the erronous response of the request with the 1X1 extent, second 
screenshot is the result of the 2X2 request).

The MapServer version we are running is 7.4.3. Here is an excerpt of the 
mapfile that is used to configure the WCS service:

LAYER
NAME ahn3_05m_dsm
METADATA
  "wcs_srs"  "EPSG:28992"
  "wcs_label"   "ahn3_05m_dsm"
  "wcs_rangeset_name"   "ahn3_05m_dsm"
  "wcs_rangeset_label"  "ahn3_05m_dsm"
  "wcs_extent"  "1 25 356250 618750"
  "wcs_resolution"  "0.5 0.5"
  "wcs_formats" "GEOTIFF_FLOAT32 GEOTIFF_BYTE GEOTIFF_INT16 
GEOTIFF_RGB"
  "wcs_imagemode"   "FLOAT32"
  "wcs_bandcount"   "1"
END
TYPE RASTER
DUMP TRUE
STATUS ON
DATA /srv/data/ahn3_05m_dsm/ahn3_05m_dsm.vrt
PROCESSING "RESAMPLE=BILINEAR"
PROJECTION
  "init=epsg:28992"
END
END

I quickly skimmed the issue tracker on Github but could not find any issue 
causing this problem. Any thoughts on the cause of the problem are highly 
appreciated.

Kind regards,

Anton Bakker, Software Engineer
Kadaster / Geo- en Vastgoedinformatie en Advies / PDOK
tel. 06 - 29 737 351
anton.bak...@kadaster.nl
www.kadaster.nl



Disclaimer:
De inhoud van dit bericht is uitsluitend bestemd voor geadresseerde.
Gebruik van de inhoud van dit bericht door anderen zonder toestemming van het 
Kadaster 
is onrechtmatig. Mocht dit bericht ten onrechte bij u terecht komen, dan 
verzoeken wij u 
dit direct te melden aan de verzender en het bericht te vernietigen. 
Aan de inhoud van dit bericht kunnen geen rechten worden ontleend.

Disclaimer:
The content of this message is meant to be received by the addressee only.
Use of the content of this message by anyone other than the addressee without 
the consent 
of the Kadaster is unlawful. If you have received this message, but are not the 
addressee, 
please contact the sender immediately and destroy the message.
No rights can be derived from the content of this message
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users