Re: [mapserver-users] geotiff 48bit with mapserver 7 wms

2017-04-19 Thread Rahkonen Jukka (MML)
Hi Cora,

Could you prepare a small sample image and put it somewhere for downloading? Or 
did you already do it in some earlier mail?

-Jukka Rahkonen-


Lähettäjä: mapserver-users  käyttäjän  
puolestaBerger, Cora 
Lähetetty: 19. huhtikuuta 2017 17:45
Vastaanottaja: 'mapserver-users@lists.osgeo.org'
Aihe: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms

Hi David,
Thanks for your help. I tried PROCESSING "SCALE=AUTO". This method results in a 
red/white image. All the labels in the map are drawn red (originally black). 
The whole topographic information in the background is just white (originally 
many different colors). I tried it with a combination of different 
outputformat-declarations and processings. Unfortunately I didn't get a correct 
result.

Cheers Cora


>Message: 2
>Date: Tue, 18 Apr 2017 14:07:04 +
>From: David 
>To: "'mapserver-users@lists.osgeo.org'"
>   
>Subject: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms
>Message-ID: 
>Content-Type: text/plain; format=flowed; charset=utf-8
>
>Hi Cora,
>
>do you use PROCESSING "SCALE=AUTO" with you LAYER definition?
>
>SCALE[_n]=AUTO or min,max
>This directive instructs the GDAL reader to pre-scale the incoming
>raster data. It is primarily used to scale 16bit or floating point data
>to the range 0-255, but can also be used to constrast stretch 8bit data.
>
>http://mapserver.org/input/raster.html#special-processing-directives
>
>Cheers David
>
>
>-- Original Message --
>From: "Berger, Cora" 
>To: "'mapserver-users@lists.osgeo.org'"
>
>Sent: 4/18/2017 10:47:42 AM
>Subject: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms
>
>>Dear David, Steve, Ben, etc.
>>I am working with MapServer-WCS. I still have problems defining the
>>correct output formats. Input to most of our WCS are 8bit Geotiffs. The
>>MapServer WCS-output is either tiff, png or jpeg with 24bit or
>>Png;mode=8bit with 8 bit (if no output format is defined). The
>>png;mode=8bit-format changes the imagecolours, so it isn't really
>>useful. I can't get a colored 8bit Geotiff as output (a 8bit-definition
>>always results in greyscale images). I tried different output
>>format-definitions, none of them worked. I can define a palette for the
>>png-format, but unfortunately not for any other format.
>>For our WCS it is important that the output-data looks the same like
>>the input-data. It seems that at the moment MapServer can't just pass
>>the input-data through... This might be a GDAL issue...
>>
>>So if you find a way to define your wished output-format, please share
>>it, maybe it helps me, too. Maybe anybody else has an idea?
>>
>>Cora
>>
>>

___
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

Re: [mapserver-users] Mapserver caching and /vsicurl/

2017-04-19 Thread Even Rouault
> Can anyone shed some light on this? How can I update imagery in s3 served
> via Postgis tile index pointing to /vsicurl/ paths without restarting
> mapserver?

You can't with the actual state of code in GDAL. This is purely a GDAL 
behaviour. Currently GDAL has a global 16 MB cache for all /vsicurl/ URLs: 1000 
blocks of 16 KB each, with a least recently used eviction strategy. So yes it 
assumes static content.
With some extra code we could imagine to evict with an option the blocks for a 
/vsicurl/ URL when the file descriptor is closed for example.

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

[mapserver-users] Mapserver caching and /vsicurl/

2017-04-19 Thread Peter Schmitt
Hi,

I am using Mapserver to render a GeoTIFF in s3 using /vsicurl/.  My raster
layer uses a tile index generated by Postgis.  Here's a snippet from my MAP
file:

CONFIG "CPL_VSIL_CURL_ALLOWED_EXTENSIONS" ".tif"
CONFIG "GDAL_DISABLE_READDIR_ON_OPEN" "YES"
CONFIG "VSI_CACHE" "FALSE"

...

LAYER
NAME update_test
TILEINDEX my_tindex
TILEITEM "location"
TYPE RASTER
END

LAYER
NAME my_tindex
TYPE POLYGON
STATUS OFF
INCLUDE "postgis.inc.map"
DATA "geom FROM (
SELECT
id,
geom,
'/vsicurl/https://s3.amazonaws.com/pschmitt-public/current.tif' as location
FROM t
WHERE ST_Intersects(t.geom, !BOX!)
) AS subquery USING UNIQUE id USING SRID=4326"
END

current.tif starts out as a red image:
https://s3.amazonaws.com/pschmitt-public/red.tif

When I make WMS requests, I see red tiles, as expected.  At some point in
time, I overwrite current.tif with this blue image:
https://s3.amazonaws.com/pschmitt-public/blue.tif

However, when I make new WMS requests, Mapserver still returns red tiles!

If I restart Mapserver, I get blue tiles.  If I then overwrite
s3://pschmitt-public/current.tif with the red image, I continue to see blue
WMS tiles until I restart Mapserver. It seems Mapserver is caching the
raster somehow when using /vsicurl/.  (side-note:  whatever caching is
going on sure is helpful when serving static imagery with /vsicurl/!
Subsequent requests to render rasters are pretty quick after an initial
render).

This does not happen if I store current.tif on local storage on my instance
& update my tile index location to be something like "/data/current.tif".
When I overwrite current.tif stored locally with red.tif and make new WMS
requests, I get red tiles.  When I overwrite current.tif stored locally
with blue.tif and make new WMS requests, I get blue tiles.

Can anyone shed some light on this? How can I update imagery in s3 served
via Postgis tile index pointing to /vsicurl/ paths without restarting
mapserver?

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

Re: [mapserver-users] geotiff 48bit with mapserver 7 wms

2017-04-19 Thread Berger, Cora
Hi David,
Thanks for your help. I tried PROCESSING "SCALE=AUTO". This method results in a 
red/white image. All the labels in the map are drawn red (originally black). 
The whole topographic information in the background is just white (originally 
many different colors). I tried it with a combination of different 
outputformat-declarations and processings. Unfortunately I didn't get a correct 
result. 

Cheers Cora


>Message: 2
>Date: Tue, 18 Apr 2017 14:07:04 +
>From: David 
>To: "'mapserver-users@lists.osgeo.org'"
>   
>Subject: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms
>Message-ID: 
>Content-Type: text/plain; format=flowed; charset=utf-8
>
>Hi Cora,
>
>do you use PROCESSING "SCALE=AUTO" with you LAYER definition?
>
>SCALE[_n]=AUTO or min,max
>This directive instructs the GDAL reader to pre-scale the incoming
>raster data. It is primarily used to scale 16bit or floating point data
>to the range 0-255, but can also be used to constrast stretch 8bit data.
>
>http://mapserver.org/input/raster.html#special-processing-directives
>
>Cheers David
>
>
>-- Original Message --
>From: "Berger, Cora" 
>To: "'mapserver-users@lists.osgeo.org'"
>
>Sent: 4/18/2017 10:47:42 AM
>Subject: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms
>
>>Dear David, Steve, Ben, etc.
>>I am working with MapServer-WCS. I still have problems defining the
>>correct output formats. Input to most of our WCS are 8bit Geotiffs. The
>>MapServer WCS-output is either tiff, png or jpeg with 24bit or
>>Png;mode=8bit with 8 bit (if no output format is defined). The
>>png;mode=8bit-format changes the imagecolours, so it isn't really
>>useful. I can't get a colored 8bit Geotiff as output (a 8bit-definition
>>always results in greyscale images). I tried different output
>>format-definitions, none of them worked. I can define a palette for the
>>png-format, but unfortunately not for any other format.
>>For our WCS it is important that the output-data looks the same like
>>the input-data. It seems that at the moment MapServer can't just pass
>>the input-data through... This might be a GDAL issue...
>>
>>So if you find a way to define your wished output-format, please share
>>it, maybe it helps me, too. Maybe anybody else has an idea?
>>
>>Cora
>>
>>

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

Re: [mapserver-users] geotiff 48bit with mapserver 7 wms

2017-04-19 Thread Schepers, Benjamin
Hi David, Hi list,

@David: you said "Well QGIS does show just a black image"

I assume that this is just a layer-specific contrast setting. Maybe just play 
around with stretching (layer properties -> style -> band rendering), e.g. set 
"min" to "0" and "max" to "255" (per each band) and then set "contrast 
enhancement" to "stretch to minmax"

Regards Ben



Mit freundlichen Grüßen
Im Auftrag

Benjamin Schepers


Geodaten, Stadtplanwerk, Luftbilder
Kronprinzenstraße 6
45128 Essen
Fon: +49 201 2069-232
Fax: +49 201 2069-369
schep...@rvr-online.de



Die Regionaldirektorin
Kronprinzenstraße 35
45128 Essen
Zentrale: +49 (0) 201 2069-0
Fax: +49 (0) 201 2069-500
www.metropoleruhr.de

Postfach 10 32 64
45032 Essen

Steuernummer: RVR 112/5797/0116
USt.-ldNr.: DE 173867500

Diese E-Mail koennte vertrauliche und/oder rechtlich geschuetzte Informationen 
enthalten.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich 
erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie 
diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail sind nicht 
gestattet.
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
-Ursprüngliche Nachricht-
Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im 
Auftrag von David
Gesendet: Dienstag, 18. April 2017 18:01
An: 'mapserver-users@lists.osgeo.org'
Betreff: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms

So, i did some testing.

The wms is not serving the images with float32 as data type. It shows the same 
issue, false colors.
The wcs is working and serving the float32 data type data.
For my use-case setting the MAXSIZE higher than the tile dimension was 
important.

Well QGIS does show just a black image, but GlobalMapper is loading the data.

Just out of curiosity, can somebody explain "WCS_SIZE" "..." to me? Is this the 
size in pixel x y for the complete TILE_INDEX?

David


-- Original Message --From: "David" 
To: "'mapserver-users@lists.osgeo.org'" 

Sent: 4/18/2017 11:07:04 AM
Subject: Re[2]: [mapserver-users] geotiff 48bit with mapserver 7 wms

>Hi Cora,
>
>do you use PROCESSING "SCALE=AUTO" with you LAYER definition?
>
>SCALE[_n]=AUTO or min,max
>This directive instructs the GDAL reader to pre-scale the incoming 
>raster data. It is primarily used to scale 16bit or floating point data 
>to the range 0-255, but can also be used to constrast stretch 8bit 
>data.
>
>http://mapserver.org/input/raster.html#special-processing-directives
>
>Cheers David
>
>
>-- Original Message --
>From: "Berger, Cora" 
>To: "'mapserver-users@lists.osgeo.org'" 
>
>Sent: 4/18/2017 10:47:42 AM
>Subject: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms
>
>>Dear David, Steve, Ben, etc.
>>I am working with MapServer-WCS. I still have problems defining the 
>>correct output formats. Input to most of our WCS are 8bit Geotiffs.
>>The MapServer WCS-output is either tiff, png or jpeg with 24bit or 
>>Png;mode=8bit with 8 bit (if no output format is defined). The 
>>png;mode=8bit-format changes the imagecolours, so it isn't really 
>>useful. I can't get a colored 8bit Geotiff as output (a 
>>8bit-definition always results in greyscale images). I tried different 
>>output format-definitions, none of them worked. I can define a palette 
>>for the png-format, but unfortunately not for any other format.
>>For our WCS it is important that the output-data looks the same like 
>>the input-data. It seems that at the moment MapServer can't just pass 
>>the input-data through... This might be a GDAL issue...
>>
>>So if you find a way to define your wished output-format, please share 
>>it, maybe it helps me, too. Maybe anybody else has an idea?
>>
>>Cora
>>
>>
>>>Message: 1
>>>Date: Mon, 17 Apr 2017 22:14:28 +
>>>From: David 
>>>To: mapserver-users@lists.osgeo.org
>>>Subject: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms
>>>Message-ID: 
>>>
>>>Content-Type: text/plain; format=flowed; charset=utf-8
>>>
>>>Thank you very much Steve. You helped me to understand the problem!
>>>
>>>David F.
>>>
>>>-- Original Message --
>>>From: "Stephen Woodbridge" 
>>>To: mapserver-users@lists.osgeo.org
>>>Sent: 4/14/2017 9:54:20 PM
>>>Subject: Re: [mapserver-users] geotiff 48bit with mapserver 7 wms
>>>
Yeah, technically a geotiff can be any format, but mapserver only 
supports a limit set for band widths.

A new version of Mapcache was just released and it has GDAL support 
in it  and serves WMS, but I'm not sure if it will do what you want.

Sorry, I'm out of ideas on this.

-Steve W

On 4/14/2017 6:56 PM, David F. wrote:
>I did not reply after my latest test, sorry.
>I tried all