[mapserver-users] Requesting TIFFs with 4 bands

2018-02-14 Thread Pablo Sanfilippo
Hi. I have TIFFs files as raster sources that contain 4 bands: R,G,B,NIR.
Is there a way to request areas of that with MapServer using
format=image/tiff and get all four bands back?

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

[mapserver-users] Map rendering correctly with shp2img but blank when using WMS

2018-02-12 Thread Pablo Sanfilippo
This is the command I'm using that renders fine:

shp2img \
-m /maps/config.map \
-o /sources/testb.png \
-e -118.41347694396971 33.919930516263086 -118.40274810791016
33.92787160756615 \
-s 500 500 \
-l mylayer \
-all_debug 5 \

And this WMS request renders a transparent image:

http://localhost:8080/?map=/maps/config.map=WMS=1.1.1%20=GetMap=mylayer==EPSG:4326=-118.41347694396971,33.919930516263086,-118.40274810791016,33.92787160756615=500=500=image/png

This is my mapfile:

# A valid mapfile used for testing
MAP
  NAME valid
  STATUS ON
  PROJECTION
"init=epsg:4326"
  END

  # IMAGECOLOR 0 0 0
  TRANSPARENT ON

  WEB
METADATA
  "wms_title"   "Slingshot WMS Server"
  "wms_onlineresource"  "http://localhost:8080/?map=config.map&;
  "wms_enable_request"  "GetCapabilities GetMap GetFeatureInfo"
  "wms_srs" "EPSG:4326 EPSG:3857"
  END
  END

  LAYER
NAME "myindex"
STATUS ON
TYPE POLYGON
CONNECTIONTYPE POSTGIS
CONNECTION "mypostgisconnection"
DATA "geometry from (select i.geometry, i.id, '/sources/' || i.path as
location from images_image) as myindex using unique id"
CLASS
  STYLE
OUTLINECOLOR 0 0 0
COLOR 0 255 0
WIDTH 1.0
ANTIALIAS true
  END
END
  END

  LAYER
NAME "mylayer"
STATUS ON
TILEINDEX "myindex"
TILEITEM "location"
PROCESSING "SCALE=AUTO"
TYPE RASTER
PROJECTION
  AUTO
END
METADATA
  "wms_title"   "My Imagery"
END
  END

END

I'm using MapServer 7.0.1

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

Re: [mapserver-users] MapServer returns a blank image when requesting a square image

2018-01-11 Thread Pablo Sanfilippo
I'm actually using MapServer 7.1 and it works fine as long as I'm using
4326 to request the tiles (whatever projection the sources of tileindex are
in). The problem is when I make the request using 3857 and the height of
the image is greater or equal to the width.

On Thu, Jan 11, 2018 at 1:02 PM, Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> You can have tileindex in different projection and it can contain images
> which are originally in several projections nowadays with in MapServer >=
> 6.4. Read http://www.gdal.org/gdaltindex.html and
> http://www.mapserver.org/optimization/tileindex.html
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* Pablo Sanfilippo [mailto:sanfilippopa...@gmail.com]
> *Lähetetty:* 11. tammikuuta 2018 17:47
> *Vastaanottaja:* Rahkonen Jukka (MML) <jukka.rahko...@maanmittauslaitos.fi
> >
> *Kopio:* Seth G <se...@geographika.co.uk>; mapserver-users@lists.osgeo.org
>
> *Aihe:* Re: [mapserver-users] MapServer returns a blank image when
> requesting a square image
>
>
>
> I'm going to try and make that zip.
>
>
>
> About explicit PROJECTION blocks, actually yes. I forgot about mentioning
> that. It works fine when explicitly setting the PROJECTION in the raster
> layer. However, I can't do that because the files referenced by the
> tileindex are in different projections.
>
>
>
> On Thu, Jan 11, 2018 at 11:00 AM, Rahkonen Jukka (MML) <jukka.rahkonen@
> maanmittauslaitos.fi> wrote:
>
> Hi,
>
>
>
> I have been using a spatialite layer as a tileindex for years without
> problems so definitely that is not a bug that affects all users and use
> cases. Try to create a zip file that contains everything that is needed for
> reproducing the issue. Let’s hope that you can make it with a spatialite
> database and two images in the tileindex.
>
>
>
> Have you already tried to add explicit PROJECTION blocks into both LAYERs?
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
>
>
> *Lähettäjä:* mapserver-users [mailto:mapserver-users-
> boun...@lists.osgeo.org] *Puolesta *Pablo Sanfilippo
> *Lähetetty:* 11. tammikuuta 2018 14:46
> *Vastaanottaja:* Seth G <se...@geographika.co.uk>
> *Kopio:* mapserver-users@lists.osgeo.org
> *Aihe:* Re: [mapserver-users] MapServer returns a blank image when
> requesting a square image
>
>
>
> Oh, so this is a definitely a bug. Is it reported yet in the issue tracker?
>
>
>
> On Wed, Jan 10, 2018 at 3:55 PM, Seth G <se...@geographika.co.uk> wrote:
>
> Hi Pablo,
>
>
>
> Just to note I also ran into this issue so you are not alone!
>
> A WMS request from OpenLayers to MapServer would be fine, but modifying
> the size of the image (WIDTH and HEIGHT parameters) would result in a blank
> image and no errors in the logs.
>
> I never got a chance to debug further though. An error should ideally be
> reported somewhere rather than a blank, seemingly valid, image.
>
>
>
> Seth
>
>
>
> --
>
> web:http://geographika.co.uk
>
> twitter: @geographika
>
>
>
>
>
> On Wed, Jan 10, 2018, at 6:46 PM, Pablo Sanfilippo wrote:
>
> Hi all,
>
>
>
> I admit this is the weirdest issue I have come across. This are the
> relevant parts of my MapServer configuration:
>
>
>
> # A valid mapfile used for testing
>
> MAP
>
>   NAME valid
>
>   STATUS ON
>
>   PROJECTION
>
> "init=epsg:4326"
>
>   END
>
>
>
>   IMAGECOLOR 0 0 0
>
>   TRANSPARENT ON
>
>
>
>   WEB
>
> METADATA
>
>   "wms_srs" "EPSG:4326 EPSG:3857"
>
>   END
>
>   END
>
>
>
>   LAYER
>
> NAME "index"
>
> STATUS ON
>
> TYPE POLYGON
>
> CONNECTIONTYPE POSTGIS
>
> CONNECTION "host=x port=x dbname=x user=x password=x"
>
> DATA "geometry from (select i.geometry, i.id, '/vsis3/' ||
> i.s3_bucket || '/' || i.s3_key as location from images_image) as index
> using unique id"
>
> CLASS
>
>   STYLE
>
> OUTLINECOLOR 0 0 0
>
> WIDTH 1.0
>
> COLOR 200 200 200
>
> ANTIALIAS true
>
>   END
>
> END
>
>   END
>
>
>
>   LAYER
>
> NAME "images"
>
> STATUS ON
>
> TILEINDEX "index"
>
> TILEITEM "location"
>
> TYPE RASTER
>
> PROJECTION
>
>   AUTO
>
> END
>
> METADATA
>
>   "wms_title"  

Re: [mapserver-users] MapServer returns a blank image when requesting a square image

2018-01-11 Thread Pablo Sanfilippo
I'm going to try and make that zip.

About explicit PROJECTION blocks, actually yes. I forgot about mentioning
that. It works fine when explicitly setting the PROJECTION in the raster
layer. However, I can't do that because the files referenced by the
tileindex are in different projections.

On Thu, Jan 11, 2018 at 11:00 AM, Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> I have been using a spatialite layer as a tileindex for years without
> problems so definitely that is not a bug that affects all users and use
> cases. Try to create a zip file that contains everything that is needed for
> reproducing the issue. Let’s hope that you can make it with a spatialite
> database and two images in the tileindex.
>
>
>
> Have you already tried to add explicit PROJECTION blocks into both LAYERs?
>
>
>
> -Jukka Rahkonen-
>
>
>
>
>
>
>
> *Lähettäjä:* mapserver-users [mailto:mapserver-users-
> boun...@lists.osgeo.org] *Puolesta *Pablo Sanfilippo
> *Lähetetty:* 11. tammikuuta 2018 14:46
> *Vastaanottaja:* Seth G <se...@geographika.co.uk>
> *Kopio:* mapserver-users@lists.osgeo.org
> *Aihe:* Re: [mapserver-users] MapServer returns a blank image when
> requesting a square image
>
>
>
> Oh, so this is a definitely a bug. Is it reported yet in the issue tracker?
>
>
>
> On Wed, Jan 10, 2018 at 3:55 PM, Seth G <se...@geographika.co.uk> wrote:
>
> Hi Pablo,
>
>
>
> Just to note I also ran into this issue so you are not alone!
>
> A WMS request from OpenLayers to MapServer would be fine, but modifying
> the size of the image (WIDTH and HEIGHT parameters) would result in a blank
> image and no errors in the logs.
>
> I never got a chance to debug further though. An error should ideally be
> reported somewhere rather than a blank, seemingly valid, image.
>
>
>
> Seth
>
>
>
> --
>
> web:http://geographika.co.uk
>
> twitter: @geographika
>
>
>
>
>
> On Wed, Jan 10, 2018, at 6:46 PM, Pablo Sanfilippo wrote:
>
> Hi all,
>
>
>
> I admit this is the weirdest issue I have come across. This are the
> relevant parts of my MapServer configuration:
>
>
>
> # A valid mapfile used for testing
>
> MAP
>
>   NAME valid
>
>   STATUS ON
>
>   PROJECTION
>
> "init=epsg:4326"
>
>   END
>
>
>
>   IMAGECOLOR 0 0 0
>
>   TRANSPARENT ON
>
>
>
>   WEB
>
> METADATA
>
>   "wms_srs" "EPSG:4326 EPSG:3857"
>
>   END
>
>   END
>
>
>
>   LAYER
>
> NAME "index"
>
> STATUS ON
>
> TYPE POLYGON
>
> CONNECTIONTYPE POSTGIS
>
> CONNECTION "host=x port=x dbname=x user=x password=x"
>
> DATA "geometry from (select i.geometry, i.id, '/vsis3/' ||
> i.s3_bucket || '/' || i.s3_key as location from images_image) as index
> using unique id"
>
> CLASS
>
>   STYLE
>
> OUTLINECOLOR 0 0 0
>
> WIDTH 1.0
>
> COLOR 200 200 200
>
> ANTIALIAS true
>
>   END
>
> END
>
>   END
>
>
>
>   LAYER
>
> NAME "images"
>
> STATUS ON
>
> TILEINDEX "index"
>
> TILEITEM "location"
>
> TYPE RASTER
>
> PROJECTION
>
>   AUTO
>
> END
>
> METADATA
>
>   "wms_title"   "Images"
>
> END
>
>   END
>
>
>
>
>
> END
>
>
>
> The data in the PostGIS index is in EPSG:4326. The images referenced by
> the index are GeoTIFFs georeferenced in EPSG:4326.
>
>
>
> A WMS request for the index layer shows the index polygons fine, whatever
> the SRS and image size in the request.
>
> A WMS request for the images layer using SRS=EPSG:4326 shows the images
> fine, whatever the image size.
>
> A WMS request for the images layer using SRS=EPSG:3857 will work fine as
> long as the requested image size's x is greater than or equal to the y. If
> not, it will return a blank (transparent) image. For example, a 1300x1299
> image will work fine, a 1300x1300 image won't work and 1301x1300 won't work
> either.
>
>
>
> Any clues?
>
>
>
> Thanks!
>
> *___*
>
> 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 mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] MapServer returns a blank image when requesting a square image

2018-01-11 Thread Pablo Sanfilippo
Oh, so this is a definitely a bug. Is it reported yet in the issue tracker?

On Wed, Jan 10, 2018 at 3:55 PM, Seth G <se...@geographika.co.uk> wrote:

> Hi Pablo,
>
> Just to note I also ran into this issue so you are not alone!
> A WMS request from OpenLayers to MapServer would be fine, but modifying
> the size of the image (WIDTH and HEIGHT parameters) would result in a blank
> image and no errors in the logs.
> I never got a chance to debug further though. An error should ideally be
> reported somewhere rather than a blank, seemingly valid, image.
>
> Seth
>
> --
> web:http://geographika.co.uk
> twitter: @geographika
>
>
> On Wed, Jan 10, 2018, at 6:46 PM, Pablo Sanfilippo wrote:
>
> Hi all,
>
> I admit this is the weirdest issue I have come across. This are the
> relevant parts of my MapServer configuration:
>
> # A valid mapfile used for testing
> MAP
>   NAME valid
>   STATUS ON
>   PROJECTION
> "init=epsg:4326"
>   END
>
>   IMAGECOLOR 0 0 0
>   TRANSPARENT ON
>
>   WEB
> METADATA
>   "wms_srs" "EPSG:4326 EPSG:3857"
>   END
>   END
>
>   LAYER
> NAME "index"
> STATUS ON
> TYPE POLYGON
> CONNECTIONTYPE POSTGIS
> CONNECTION "host=x port=x dbname=x user=x password=x"
> DATA "geometry from (select i.geometry, i.id, '/vsis3/' ||
> i.s3_bucket || '/' || i.s3_key as location from images_image) as index
> using unique id"
> CLASS
>   STYLE
> OUTLINECOLOR 0 0 0
> WIDTH 1.0
> COLOR 200 200 200
> ANTIALIAS true
>   END
> END
>   END
>
>   LAYER
> NAME "images"
> STATUS ON
> TILEINDEX "index"
> TILEITEM "location"
> TYPE RASTER
> PROJECTION
>   AUTO
> END
> METADATA
>   "wms_title"   "Images"
> END
>   END
>
>
> END
>
> The data in the PostGIS index is in EPSG:4326. The images referenced by
> the index are GeoTIFFs georeferenced in EPSG:4326.
>
> A WMS request for the index layer shows the index polygons fine, whatever
> the SRS and image size in the request.
> A WMS request for the images layer using SRS=EPSG:4326 shows the images
> fine, whatever the image size.
> A WMS request for the images layer using SRS=EPSG:3857 will work fine as
> long as the requested image size's x is greater than or equal to the y. If
> not, it will return a blank (transparent) image. For example, a 1300x1299
> image will work fine, a 1300x1300 image won't work and 1301x1300 won't work
> either.
>
> Any clues?
>
> Thanks!
> *___*
> 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 mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] MapServer returns a blank image when requesting a square image

2018-01-10 Thread Pablo Sanfilippo
Hi all,

I admit this is the weirdest issue I have come across. This are the
relevant parts of my MapServer configuration:

# A valid mapfile used for testing
MAP
  NAME valid
  STATUS ON
  PROJECTION
"init=epsg:4326"
  END

  IMAGECOLOR 0 0 0
  TRANSPARENT ON

  WEB
METADATA
  "wms_srs" "EPSG:4326 EPSG:3857"
  END
  END

  LAYER
NAME "index"
STATUS ON
TYPE POLYGON
CONNECTIONTYPE POSTGIS
CONNECTION "host=x port=x dbname=x user=x password=x"
DATA "geometry from (select i.geometry, i.id, '/vsis3/' || i.s3_bucket
|| '/' || i.s3_key as location from images_image) as index using unique id"
CLASS
  STYLE
OUTLINECOLOR 0 0 0
WIDTH 1.0
COLOR 200 200 200
ANTIALIAS true
  END
END
  END

  LAYER
NAME "images"
STATUS ON
TILEINDEX "index"
TILEITEM "location"
TYPE RASTER
PROJECTION
  AUTO
END
METADATA
  "wms_title"   "Images"
END
  END


END

The data in the PostGIS index is in EPSG:4326. The images referenced by the
index are GeoTIFFs georeferenced in EPSG:4326.

A WMS request for the index layer shows the index polygons fine, whatever
the SRS and image size in the request.
A WMS request for the images layer using SRS=EPSG:4326 shows the images
fine, whatever the image size.
A WMS request for the images layer using SRS=EPSG:3857 will work fine as
long as the requested image size's x is greater than or equal to the y. If
not, it will return a blank (transparent) image. For example, a 1300x1299
image will work fine, a 1300x1300 image won't work and 1301x1300 won't work
either.

Any clues?

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