Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-19 Thread Eichner, Andreas - SID-NLKM
Have you set the PROCESSING directive at the grid layer? With the patch 
applied, adding PROCESSING FORCE_FULL_EXTENT=YES at the GRID layer fixed 
it for me, ie:

 LAYER
 TYPE LINE
 STATUS DEFAULT
 EXTENT -180 -90 180 90
 NAME GRID
 OPACITY 50

 # the following line enables the hack:
PROCESSING FORCE_FULL_EXTENT=YES

I used the BBOXes from your examples below to generate the attached images.

 The POSTGIS (i.e. POLYGON) and RASTER layers are fine in any zoom or
 pan
 level. The LINE layer is ok if the BBOX has not been paned to far of
 center (for the ortho projection) and if extremly zoomed in the
 poles
 are cut.
 
 It looks like that POLYGON and LINE Layers are treated a little bit
 differently.
 
 If you like here is the test site with the patch included.
 
 Zoomed in, plus poles cut out in LINE layer:
 http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-250,-
 250,250,250FORMAT=IMAGE/PNGFROMDAT=2006-08-
 06%2000:00HOEHE=-
 1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
 PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0816STYLES=TI
 ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
 07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600
 
 Half a LINE layer missing when BBOX to far off center:
 http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,-
 650,250,250FORMAT=IMAGE/PNGFROMDAT=2006-08-
 06%2000:00HOEHE=-
 1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
 PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0816STYLES=TI
 ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
 07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600
 
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-19 Thread Heiko Schröter

Oh Andreas, blind me.
Copied it into the POSTGIS layer but not the LINE Layer.
Sorry for that.
It works now as described, panning and zooming is ok.

Btw, where to send the bugreport ?

Thanks and sorry for the additional noise.

Regards
Heiko


Am 19.12.2013 10:01, schrieb Eichner, Andreas - SID-NLKM:

Narf. Send before attaching the images. So here it goes again, sorry.

Have you set the PROCESSING directive at the grid layer? With the
patch applied, adding PROCESSING FORCE_FULL_EXTENT=YES at the GRID layer
fixed it for me, ie:
  
   LAYER

   TYPE LINE
   STATUS DEFAULT
   EXTENT -180 -90 180 90
   NAME GRID
   OPACITY 50
  
   # the following line enables the hack:

   PROCESSING FORCE_FULL_EXTENT=YES
  
I used the BBOXes from your examples below to generate the attached

images.


The POSTGIS (i.e. POLYGON) and RASTER layers are fine in any zoom or
pan
level. The LINE layer is ok if the BBOX has not been paned to far of
center (for the ortho projection) and if extremly zoomed in the
poles
are cut.

It looks like that POLYGON and LINE Layers are treated a little bit
differently.

If you like here is the test site with the patch included.

Zoomed in, plus poles cut out in LINE layer:
http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-250,-
250,250,250FORMAT=IMAGE/PNGFROMDAT=2006-08-
06%2000:00HOEHE=-
1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0816STYLES=TI
ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600

Half a LINE layer missing when BBOX to far off center:
http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,-
650,250,250FORMAT=IMAGE/PNGFROMDAT=2006-08-
06%2000:00HOEHE=-
1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0816STYLES=TI
ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600



--
---
Dipl.-Ing. Heiko Schröter
Institute of Environmental Physics (IUP)   phone: ++49-(0)421-218-62092
Institute of Remote Sensing (IFE)  fax:   ++49-(0)421-218-62070
University of Bremen (FB1)
P.O. Box 330440   email:  schro...@iup.physik.uni-bremen.de
Otto-Hahn-Allee 1
28359 Bremen
Germany
---

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


Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-19 Thread Eichner, Andreas - SID-NLKM

 Oh Andreas, blind me.
 Copied it into the POSTGIS layer but not the LINE Layer.
 Sorry for that.
 It works now as described, panning and zooming is ok.
 
 Btw, where to send the bugreport ?


No problem. I just found https://github.com/mapserver/mapserver/issues/4483 
which is tagged with MapScript. But reading through the bug description it 
sound like it is strongly related to your case. Since your problem seems to 
start in msDrawVectorLayer() this turns into a more general problem.
I'm currently wondering why msProjectRect() transforms your request BBOX 
(-650,-650,250,250) into 
(-179.464412, 0.002066, 178.470560, 66.995391) and returns MS_SUCCESS.

It seems to be a good idea to create a new issue at 
https://github.com/mapserver/mapserver/issues, tag it with Bug, Proj 
Support and MapServer C Library, reference the issue mentioned above and 
attach the map file, proj string and request that triggers the issue. You 
should also mention the found cause: msProjectRect() used by 
msDrawVectorLayer() doesn't create a proper query BBOX to fetch the features in 
such cases.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-19 Thread Eichner, Andreas - SID-NLKM
Looks like it has been found already 2 years ago, so you might hook onto this

https://github.com/mapserver/mapserver/issues/4035


 -Ursprüngliche Nachricht-
 Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-
 boun...@lists.osgeo.org] Im Auftrag von Eichner, Andreas - SID-NLKM
 Gesendet: Donnerstag, 19. Dezember 2013 14:16
 An: 'Heiko Schröter'; mapserver-users@lists.osgeo.org
 Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and -
 wo EXTRA_SOURCE parameter
 
 
  Oh Andreas, blind me.
  Copied it into the POSTGIS layer but not the LINE Layer.
  Sorry for that.
  It works now as described, panning and zooming is ok.
 
  Btw, where to send the bugreport ?
 
 
 No problem. I just found
 https://github.com/mapserver/mapserver/issues/4483 which is tagged
 with MapScript. But reading through the bug description it sound like
 it is strongly related to your case. Since your problem seems to
 start in msDrawVectorLayer() this turns into a more general problem.
 I'm currently wondering why msProjectRect() transforms your request
 BBOX (-650,-650,250,250) into
 (-179.464412, 0.002066, 178.470560, 66.995391) and returns
 MS_SUCCESS.
 
 It seems to be a good idea to create a new issue at
 https://github.com/mapserver/mapserver/issues, tag it with Bug,
 Proj Support and MapServer C Library, reference the issue
 mentioned above and attach the map file, proj string and request that
 triggers the issue. You should also mention the found cause:
 msProjectRect() used by msDrawVectorLayer() doesn't create a proper
 query BBOX to fetch the features in such cases.
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-18 Thread Eichner, Andreas - SID-NLKM
Can you provide a simple test case, probably a MAP file with inline data? I've 
created some simple test data but I am unable to reproduce the problem. 

 -Ursprüngliche Nachricht-
 Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
 Gesendet: Dienstag, 17. Dezember 2013 21:01
 An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org;
 Heiko Schröter
 Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and -
 wo EXTRA_SOURCE parameter
 
 Seems not to work. Failure can be reproduced by changing BBOX params.
 I've setup a test site with three layers so you may have a look.
 Blue Marble = RASTER
 Grid = LINE
 Coloured Rect = POSTGIS
 
 
 Warping ok from epsg4326-ortho:
 
 http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,-
 650,650,650FORMAT=IMAGE/PNGFROMDAT=2006-08-
 06%2000:00HOEHE=-
 1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
 PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0815STYLES=TI
 ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
 07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600
 
 Warping distorted:
 
 http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-450,-
 450,450,450FORMAT=IMAGE/PNGFROMDAT=2006-08-
 06%2000:00HOEHE=-
 1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
 PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0815STYLES=TI
 ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
 07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600
 
 
 
 Am 17.12.2013 17:57, schrieb Eichner, Andreas - SID-NLKM:
  Can you try if PROCESSING POLYLINE_NO_CLIP=YES helps on TYPE LINE
 layers?
 
  -Ursprüngliche Nachricht-
  Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
  Gesendet: Dienstag, 17. Dezember 2013 16:46
  An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org
  Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL
 and -
  wo EXTRA_SOURCE parameter
 
  Thanks for the hint, but sorry no, does not change rewarping
  behaviour
  of POLYGON or LINE Layers.
  Distortion and missing parts do remain.
 
  The odd thing:
  The projection of all layers is ok if the BBOX equals or is
 greater
  than
  max extension of the map.
  i.e. BBOX=-650,-650,650,650 [proj=ortho units=m]
  By zooming in i.e. reducing the BBOX the RASTER layer rewarps
 ok,
  POLYGON and LINE layers do not.
 
 
  Am 17.12.2013 16:11, schrieb Eichner, Andreas - SID-NLKM:
  Looks like that causes the same effect as setting
  PROCESSING LOAD_WHOLE_IMAGE=YES
 
  -Ursprüngliche Nachricht-
  Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-
  users-
  boun...@lists.osgeo.org] Im Auftrag von Heiko Schröter
  Gesendet: Dienstag, 17. Dezember 2013 14:09
  An: mapserver-users@lists.osgeo.org
  Betreff: [mapserver-users] Rewarping/Reprojection with GDAL and
 -
  wo
  EXTRA_SOURCE parameter
 
  To make use of it in mapserver a hint has been given in an old
  mailing
  thread (sorry, lost the source) to adjust the following code
  snippet
  in
  resample.c:
 
  Version: mapserver-6.4.0
  resample.c
  snip
  /* -
 --
  ---
  -- */
   /*  Project desired extents out by 2 pixels, and then
  strip
  to  */
   /*  available
  data. */
   /*
  
 --
  --
  */
   memcpy( sOrigSrcExtent, sSrcExtent, sizeof(sSrcExtent) );
   sSrcExtent.minx = floor(sSrcExtent.minx-1.0);
   sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0);
   sSrcExtent.miny = floor(sSrcExtent.miny-1.0);
   sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0);
  snap
 
  Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER
  image
  correctly.
 
 
 
 
  --
  --
 ---
  --
  Dipl.-Ing. Heiko Schröter
  Institute of Environmental Physics (IUP)   phone: ++49-(0)421-218-
  62092
  Institute of Remote Sensing (IFE)  fax:   ++49-(0)421-218-
  62070
  University of Bremen (FB1)
  P.O. Box 330440   email:  schro...@iup.physik.uni-
  bremen.de
  Otto-Hahn-Allee 1
  28359 Bremen
  Germany
  --
 ---
  --
 
 

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


Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-18 Thread Heiko Schröter
I've omitted the postgis stuff in the mapfile, because of access 
restrictions.

In the EPSG file i have placed this dummy epsg code for reprojection:

snip
0815 +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84 
+units=m +no_defs  

snap


MAP
NAME WELT

OUTPUTFORMAT
  NAME aggpng24
  DRIVER AGG/PNG
  MIMETYPE image/png
  IMAGEMODE RGB
  EXTENSION png
END

STATUS ON
SHAPEPATH /your/shape/path/

TRANSPARENT ON
MAXSIZE 1

# Requesting polar plot with a dummy EPSG:0815 in epsg file
# 0815 +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 
+datum=WGS84 +units=m +no_defs  

PROJECTION
 init=epsg:4326
END

WEB
 IMAGEPATH /var/www/localhost/htdocs/tmpimages/
 IMAGEURL /tmpimages/
  METADATA
   ows_srs EPSG:4326 EPSG:0815 EPSG:0816 EPSG:3857 EPSG:900913
   wms_enable_request *
 END
END

LAYER
EXTENT -180 -90 180 90
NAME KARTE1
TYPE RASTER
STATUS OFF
OPACITY 100
DATA YourMap.png
METADATA
wms_title karte layer
END
PROJECTION
init=epsg:4326
END

CLASS
NAME karte_class
OUTLINECOLOR 0 0 0
COLOR 180 180 180
SYMBOL 0
END
END # Layer

LAYER
TYPE LINE
STATUS OFF
EXTENT -180 -90 180 90
NAME GRID
OPACITY 50
METADATA
wms_title grid layer
END
PROJECTION
init=epsg:4326
END
CLASS
NAME Graticule
STYLE
COLOR 180 90 0
MAXWIDTH 2
MINWIDTH 2
END
END
GRID
LABELFORMAT DD MAXARCS 1 MININTERVAL 15 MAXINTERVAL 60 
MAXSUBDIVIDE 360

END
END # Layer
END # Ende Map





Am 18.12.2013 11:27, schrieb Eichner, Andreas - SID-NLKM:

Can you provide a simple test case, probably a MAP file with inline data? I've 
created some simple test data but I am unable to reproduce the problem.


-Ursprüngliche Nachricht-
Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
Gesendet: Dienstag, 17. Dezember 2013 21:01
An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org;
Heiko Schröter
Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and -
wo EXTRA_SOURCE parameter

Seems not to work. Failure can be reproduced by changing BBOX params.
I've setup a test site with three layers so you may have a look.
Blue Marble = RASTER
Grid = LINE
Coloured Rect = POSTGIS


Warping ok from epsg4326-ortho:

http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,-
650,650,650FORMAT=IMAGE/PNGFROMDAT=2006-08-
06%2000:00HOEHE=-
1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0815STYLES=TI
ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600

Warping distorted:

http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-450,-
450,450,450FORMAT=IMAGE/PNGFROMDAT=2006-08-
06%2000:00HOEHE=-
1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0815STYLES=TI
ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600



Am 17.12.2013 17:57, schrieb Eichner, Andreas - SID-NLKM:

Can you try if PROCESSING POLYLINE_NO_CLIP=YES helps on TYPE LINE

layers?

-Ursprüngliche Nachricht-
Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
Gesendet: Dienstag, 17. Dezember 2013 16:46
An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org
Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL

and -

wo EXTRA_SOURCE parameter

Thanks for the hint, but sorry no, does not change rewarping
behaviour
of POLYGON or LINE Layers.
Distortion and missing parts do remain.

The odd thing:
The projection of all layers is ok if the BBOX equals or is

greater

than
max extension of the map.
i.e. BBOX=-650,-650,650,650 [proj=ortho units=m]
By zooming in i.e. reducing the BBOX the RASTER layer rewarps

ok,

POLYGON and LINE layers do not.


Am 17.12.2013 16:11, schrieb Eichner, Andreas - SID-NLKM:

Looks like that causes the same effect as setting
 PROCESSING LOAD_WHOLE_IMAGE=YES


-Ursprüngliche Nachricht-
Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-

users-

boun...@lists.osgeo.org] Im Auftrag von Heiko Schröter
Gesendet: Dienstag, 17. Dezember 2013 14:09
An: mapserver-users@lists.osgeo.org
Betreff: [mapserver-users] Rewarping/Reprojection with GDAL and

-

wo

EXTRA_SOURCE parameter

To make use of it in mapserver a hint has been given in an old
mailing
thread (sorry, lost the source) to adjust the following code

snippet

in
resample.c:

Version: mapserver-6.4.0
resample.c
snip

Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-18 Thread Eichner, Andreas - SID-NLKM

Hello Heiko,

the problem is the way mapserver builds the source extent. A quick fix might be 
introducing a processing directive to force mapserver using the layer's full 
extent:

diff --git a/mapdraw.c b/mapdraw.c
index 992838d..7f2179e 100644
--- a/mapdraw.c
+++ b/mapdraw.c
@@ -948,6 +948,9 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, 
imageObj *image)
   if(layer-transform == MS_TRUE) {
 searchrect = map-extent;
 #ifdef USE_PROJ
+if (msLayerGetProcessingKey(layer, FORCE_FULL_EXTENT))
+  searchrect = layer-extent;
+else
 if((map-projection.numargs  0)  (layer-projection.numargs  0))
   msProjectRect(map-projection, layer-projection, searchrect); /* 
project the searchrect to source coords */
 #endif

With this small patch you can rebuild mapserver and use
  PROCESSING FORCE_FULL_EXTENT=YES 
In a vector layer .

As said, this should be considered a quick fix. A bug should be reported on 
this as other parts in the code path seem to deal more nicely in such 
situations.

HTH

 -Ursprüngliche Nachricht-
 Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
 Gesendet: Mittwoch, 18. Dezember 2013 12:19
 An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org
 Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and -
 wo EXTRA_SOURCE parameter
 
 I've omitted the postgis stuff in the mapfile, because of access
 restrictions.
 In the EPSG file i have placed this dummy epsg code for reprojection:
 
 snip
 0815 +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84
 +units=m +no_defs  
 snap
 
 
 MAP
  NAME WELT
 
  OUTPUTFORMAT
NAME aggpng24
DRIVER AGG/PNG
MIMETYPE image/png
IMAGEMODE RGB
EXTENSION png
  END
 
  STATUS ON
  SHAPEPATH /your/shape/path/
 
  TRANSPARENT ON
  MAXSIZE 1
 
  # Requesting polar plot with a dummy EPSG:0815 in epsg file
  # 0815 +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84
 +datum=WGS84 +units=m +no_defs  
  PROJECTION
   init=epsg:4326
  END
 
  WEB
   IMAGEPATH /var/www/localhost/htdocs/tmpimages/
   IMAGEURL /tmpimages/
METADATA
 ows_srs EPSG:4326 EPSG:0815 EPSG:0816 EPSG:3857
 EPSG:900913
 wms_enable_request *
   END
  END
 
  LAYER
  EXTENT -180 -90 180 90
  NAME KARTE1
  TYPE RASTER
  STATUS OFF
  OPACITY 100
  DATA YourMap.png
  METADATA
  wms_title karte layer
  END
  PROJECTION
  init=epsg:4326
  END
 
  CLASS
  NAME karte_class
  OUTLINECOLOR 0 0 0
  COLOR 180 180 180
  SYMBOL 0
  END
  END # Layer
 
  LAYER
  TYPE LINE
  STATUS OFF
  EXTENT -180 -90 180 90
  NAME GRID
  OPACITY 50
  METADATA
  wms_title grid layer
  END
  PROJECTION
  init=epsg:4326
  END
  CLASS
  NAME Graticule
  STYLE
  COLOR 180 90 0
  MAXWIDTH 2
  MINWIDTH 2
  END
  END
  GRID
  LABELFORMAT DD MAXARCS 1 MININTERVAL 15 MAXINTERVAL 60
 MAXSUBDIVIDE 360
  END
  END # Layer
 END # Ende Map
 
 
 
 
 
 Am 18.12.2013 11:27, schrieb Eichner, Andreas - SID-NLKM:
  Can you provide a simple test case, probably a MAP file with inline
 data? I've created some simple test data but I am unable to reproduce
 the problem.
 
  -Ursprüngliche Nachricht-
  Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
  Gesendet: Dienstag, 17. Dezember 2013 21:01
  An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org;
  Heiko Schröter
  Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL
 and -
  wo EXTRA_SOURCE parameter
 
  Seems not to work. Failure can be reproduced by changing BBOX
 params.
  I've setup a test site with three layers so you may have a look.
  Blue Marble = RASTER
  Grid = LINE
  Coloured Rect = POSTGIS
 
 
  Warping ok from epsg4326-ortho:
 
  http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-
 650,-
  650,650,650FORMAT=IMAGE/PNGFROMDAT=2006-08-
  06%2000:00HOEHE=-
 
 1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
 
 PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0815STYLES=TI
  ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
  07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600
 
  Warping distorted:
 
  http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-
 450,-
  450,450,450FORMAT=IMAGE/PNGFROMDAT=2006-08-
  06%2000:00HOEHE=-
 
 1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.map
 
 PRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0815STYLES=TI
  ME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-
  07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT

Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-18 Thread Heiko Schröter

Hello Andreas,

thanks for the patch.

The POSTGIS (i.e. POLYGON) and RASTER layers are fine in any zoom or pan 
level. The LINE layer is ok if the BBOX has not been paned to far of 
center (for the ortho projection) and if extremly zoomed in the poles 
are cut.


It looks like that POLYGON and LINE Layers are treated a little bit 
differently.


If you like here is the test site with the patch included.

Zoomed in, plus poles cut out in LINE layer:
http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-250,-250,250,250FORMAT=IMAGE/PNGFROMDAT=2006-08-06%2000:00HOEHE=-1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.mapPRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0816STYLES=TIME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600

Half a LINE layer missing when BBOX to far off center:
http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,-650,250,250FORMAT=IMAGE/PNGFROMDAT=2006-08-06%2000:00HOEHE=-1LAYERS=KARTE1,WILLI,GRIDMAP=/var/www/localhost/mapserver/laura.mapPRODUKT=stro3_21REQUEST=GETMAPSERVICE=WMSSRS=EPSG:0816STYLES=TIME=2006-10-06%2000:00/2006-10-08%2023:59TODAT=2006-08-07%2023:59TRANSPARENT=FALSEVERSION=1.1.1WIDTH=600HEIGHT=600

Regards
Heiko




Am 18.12.2013 16:25, schrieb Eichner, Andreas - SID-NLKM:


Hello Heiko,

the problem is the way mapserver builds the source extent. A quick fix might be 
introducing a processing directive to force mapserver using the layer's full 
extent:

diff --git a/mapdraw.c b/mapdraw.c
index 992838d..7f2179e 100644
--- a/mapdraw.c
+++ b/mapdraw.c
@@ -948,6 +948,9 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, 
imageObj *image)
if(layer-transform == MS_TRUE) {
  searchrect = map-extent;
  #ifdef USE_PROJ
+if (msLayerGetProcessingKey(layer, FORCE_FULL_EXTENT))
+  searchrect = layer-extent;
+else
  if((map-projection.numargs  0)  (layer-projection.numargs  0))
msProjectRect(map-projection, layer-projection, searchrect); /* 
project the searchrect to source coords */
  #endif

With this small patch you can rebuild mapserver and use
   PROCESSING FORCE_FULL_EXTENT=YES
In a vector layer .

As said, this should be considered a quick fix. A bug should be reported on 
this as other parts in the code path seem to deal more nicely in such 
situations.

HTH


-Ursprüngliche Nachricht-
Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
Gesendet: Mittwoch, 18. Dezember 2013 12:19
An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org
Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and -
wo EXTRA_SOURCE parameter

I've omitted the postgis stuff in the mapfile, because of access
restrictions.
In the EPSG file i have placed this dummy epsg code for reprojection:

snip
0815 +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84
+units=m +no_defs  
snap


MAP
  NAME WELT

  OUTPUTFORMAT
NAME aggpng24
DRIVER AGG/PNG
MIMETYPE image/png
IMAGEMODE RGB
EXTENSION png
  END

  STATUS ON
  SHAPEPATH /your/shape/path/

  TRANSPARENT ON
  MAXSIZE 1

  # Requesting polar plot with a dummy EPSG:0815 in epsg file
  # 0815 +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84
+datum=WGS84 +units=m +no_defs  
  PROJECTION
   init=epsg:4326
  END

  WEB
   IMAGEPATH /var/www/localhost/htdocs/tmpimages/
   IMAGEURL /tmpimages/
METADATA
 ows_srs EPSG:4326 EPSG:0815 EPSG:0816 EPSG:3857
EPSG:900913
 wms_enable_request *
   END
  END

  LAYER
  EXTENT -180 -90 180 90
  NAME KARTE1
  TYPE RASTER
  STATUS OFF
  OPACITY 100
  DATA YourMap.png
  METADATA
  wms_title karte layer
  END
  PROJECTION
  init=epsg:4326
  END

  CLASS
  NAME karte_class
  OUTLINECOLOR 0 0 0
  COLOR 180 180 180
  SYMBOL 0
  END
  END # Layer

  LAYER
  TYPE LINE
  STATUS OFF
  EXTENT -180 -90 180 90
  NAME GRID
  OPACITY 50
  METADATA
  wms_title grid layer
  END
  PROJECTION
  init=epsg:4326
  END
  CLASS
  NAME Graticule
  STYLE
  COLOR 180 90 0
  MAXWIDTH 2
  MINWIDTH 2
  END
  END
  GRID
  LABELFORMAT DD MAXARCS 1 MININTERVAL 15 MAXINTERVAL 60
MAXSUBDIVIDE 360
  END
  END # Layer
END # Ende Map





Am 18.12.2013 11:27, schrieb Eichner, Andreas - SID-NLKM:

Can you provide a simple test case, probably a MAP file with inline

data? I've created some simple test data but I am unable to reproduce
the problem.



-Ursprüngliche Nachricht-
Von: Heiko Schröter [mailto:schro...@iup.physik.uni

[mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-17 Thread Heiko Schröter

Hello all,

we need to rewarp epsg:4326 to polar i.e. +proj=ortho +over +lon_0=0 
+lat_0=90 +ellps=WGS84 +datum=WGS84 +units=m +no_defs for satellite 
data projection.
The problem is that not enough data are read from the source raster 
image and the map is cutout at the poles.


gdalwarp can be passed a switch i.e. -wo EXTRA_SOURCE=750, which gives 
the correct warped image on the commandline.


To make use of it in mapserver a hint has been given in an old mailing 
thread (sorry, lost the source) to adjust the following code snippet in 
resample.c:


Version: mapserver-6.4.0
resample.c
snip
/*  */
  /*  Project desired extents out by 2 pixels, and then strip 
to  */
  /*  available 
data. */
  /* 
 */

  memcpy( sOrigSrcExtent, sSrcExtent, sizeof(sSrcExtent) );
  sSrcExtent.minx = floor(sSrcExtent.minx-1.0);
  sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0);
  sSrcExtent.miny = floor(sSrcExtent.miny-1.0);
  sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0);
snap

Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER image 
correctly.


Unfortunatly using POSTGIS layer or LINE type layer (i.e. for a grid) 
the reprojection is distorted as before for the RASTER layer.


Is there an option or a place in the sources where the POSTGIS or LINE 
data layers are handled so that a workaround as above for the RASTER 
Layer could be used ?


I could imagine that it would be a good idea to have a parameter 
EXTRA_SOURCE in the mapfile if need be for polar plots.


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


Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-17 Thread Eichner, Andreas - SID-NLKM
Looks like that causes the same effect as setting
  PROCESSING LOAD_WHOLE_IMAGE=YES

 -Ursprüngliche Nachricht-
 Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-
 boun...@lists.osgeo.org] Im Auftrag von Heiko Schröter
 Gesendet: Dienstag, 17. Dezember 2013 14:09
 An: mapserver-users@lists.osgeo.org
 Betreff: [mapserver-users] Rewarping/Reprojection with GDAL and -wo
 EXTRA_SOURCE parameter
 
 To make use of it in mapserver a hint has been given in an old
 mailing
 thread (sorry, lost the source) to adjust the following code snippet
 in
 resample.c:
 
 Version: mapserver-6.4.0
 resample.c
 snip
 /* --
 -- */
/*  Project desired extents out by 2 pixels, and then strip
 to  */
/*  available
 data. */
/*
 
 */
memcpy( sOrigSrcExtent, sSrcExtent, sizeof(sSrcExtent) );
sSrcExtent.minx = floor(sSrcExtent.minx-1.0);
sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0);
sSrcExtent.miny = floor(sSrcExtent.miny-1.0);
sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0);
 snap
 
 Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER image
 correctly.
 
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter

2013-12-17 Thread Eichner, Andreas - SID-NLKM
Can you try if PROCESSING POLYLINE_NO_CLIP=YES helps on TYPE LINE layers?

 -Ursprüngliche Nachricht-
 Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de]
 Gesendet: Dienstag, 17. Dezember 2013 16:46
 An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org
 Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and -
 wo EXTRA_SOURCE parameter
 
 Thanks for the hint, but sorry no, does not change rewarping
 behaviour
 of POLYGON or LINE Layers.
 Distortion and missing parts do remain.
 
 The odd thing:
 The projection of all layers is ok if the BBOX equals or is greater
 than
 max extension of the map.
 i.e. BBOX=-650,-650,650,650 [proj=ortho units=m]
 By zooming in i.e. reducing the BBOX the RASTER layer rewarps ok,
 POLYGON and LINE layers do not.
 
 
 Am 17.12.2013 16:11, schrieb Eichner, Andreas - SID-NLKM:
  Looks like that causes the same effect as setting
 PROCESSING LOAD_WHOLE_IMAGE=YES
 
  -Ursprüngliche Nachricht-
  Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-
 users-
  boun...@lists.osgeo.org] Im Auftrag von Heiko Schröter
  Gesendet: Dienstag, 17. Dezember 2013 14:09
  An: mapserver-users@lists.osgeo.org
  Betreff: [mapserver-users] Rewarping/Reprojection with GDAL and -
 wo
  EXTRA_SOURCE parameter
 
  To make use of it in mapserver a hint has been given in an old
  mailing
  thread (sorry, lost the source) to adjust the following code
 snippet
  in
  resample.c:
 
  Version: mapserver-6.4.0
  resample.c
  snip
  /* ---
 ---
  -- */
  /*  Project desired extents out by 2 pixels, and then
 strip
  to  */
  /*  available
  data. */
  /*
  --
 --
  */
  memcpy( sOrigSrcExtent, sSrcExtent, sizeof(sSrcExtent) );
  sSrcExtent.minx = floor(sSrcExtent.minx-1.0);
  sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0);
  sSrcExtent.miny = floor(sSrcExtent.miny-1.0);
  sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0);
  snap
 
  Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER
 image
  correctly.
 
 
 
 
 --
 -
 --
 Dipl.-Ing. Heiko Schröter
 Institute of Environmental Physics (IUP)   phone: ++49-(0)421-218-
 62092
 Institute of Remote Sensing (IFE)  fax:   ++49-(0)421-218-
 62070
 University of Bremen (FB1)
 P.O. Box 330440   email:  schro...@iup.physik.uni-
 bremen.de
 Otto-Hahn-Allee 1
 28359 Bremen
 Germany
 -
 --

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