Fwd: Problem with raster and ortho projection
Diego Savardi
diego.savardi at GMAIL.COM
Wed Sep 7 09:10:03 PDT 2005
Hi Frank, thanks for your help.
I've follow your advice and I have tried with 'shp2img' and a simpler
mapfile, using the country shapefile that comes with ArcView. The
result is still that some points of the shapes falls in (0, 0).
Here in attachment the are the mapfile and the image generated.
Here is the log:
baobab:/data/bluemarble/map# shp2img -v
MapServer version 4.6.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=THREADS INPUT=EPPL7 INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG
baobab:/data/bluemarble/map# shp2img -m shporto.map -o shporto.jpg
[Wed Sep 7 17:44:03 2005].670840 msProjectRect(): some points failed
to reproject, doing internal sampling.
[Wed Sep 7 17:44:03 2005].859659 msDrawMap(): Layer 0 (Country), 0.203s
[Wed Sep 7 17:44:03 2005].859888 msDrawMap(): Drawing Label Cache, 0.000s
[Wed Sep 7 17:44:03 2005].860015 msDrawMap() total time: 0.207s
I don't know if the problem could be in the projection settings, I've
seen some other over Internet and mine seems corrects to me, but I
could be wrong..
This is the mapfile:
MAP
NAME world_
EXTENT -6500000 -6500000 6500000 6500000
SIZE 600 600
SYMBOLSET '../web/symbols/symbols.sym'
SHAPEPATH 'data'
FONTSET '../web/fonts/fonts.list'
DEBUG on
UNITS meters
IMAGETYPE jpeg
IMAGECOLOR 0 0 0
OUTPUTFORMAT
NAME jpeg
DRIVER "GD/JPEG"
FORMATOPTION "QUALITY=75"
MIMETYPE "image/jpeg"
IMAGEMODE RGB
EXTENSION "jpg"
END
WEB
TEMPLATE '../web/template.html'
IMAGEPATH '../web/tmp/'
IMAGEURL '/gis/bluemarble/tmp/'
END
PROJECTION
"proj=ortho"
"lat_0=0.0"
"lon_0=0.0"
"x_0=0.0"
"y_0=0.0"
END
# LAYERS ---------------------------------------------
LAYER
DATA "country"
NAME "Country"
PROJECTION
"init=epsg:4326"
END
STATUS DEFAULT
TYPE LINE
CLASS
STYLE
COLOR 0 255 0
SIZE 2
SYMBOL 1
END
END
END
# LAYERS END -------------------------------
END # MAP END -------------------------------
And the image is here: http://www.daisyred.it/share/shporto.jpg
With the raster the problem is the same also with shp2img. I've seen
the processing parameters inside the code, but it seems there are
still problems defining which points have to be drawn.
baobab:/data/bluemarble/map# shp2img -m tifforto.map -o tifforto.jpg
[Wed Sep 7 18:00:19 2005].753468 msDrawRasterLayerLow(earth_2400): entering.
[Wed Sep 7 18:00:19 2005].756026 msTransformMapToSource():
pj_transform() failed. Out of bounds? Loading whole image.
[Wed Sep 7 18:00:19 2005].756204 msResampleGDALToMap in effect:
cellsize = 0.150000
[Wed Sep 7 18:00:19 2005].789060 msDrawGDAL(earth_2400): using
RAW_WINDOW=0 0 2400 1200
[Wed Sep 7 18:00:19 2005].789376 msDrawGDAL(): red,green,blue,alpha
bands = 1,2,3,0
[Wed Sep 7 18:00:19 2005].978416 msSimpleRasterResampler: 228000
failed to transform, 132000 actually set.
[Wed Sep 7 18:00:19 2005].981821 msDrawMap(): Layer 0 (earth_2400), 0.228s
[Wed Sep 7 18:00:19 2005].982038 msDrawMap(): Drawing Label Cache, 0.000s
[Wed Sep 7 18:00:19 2005].982158 msDrawMap() total time: 0.233s
Differences from the previous mapfile:
....
EXTENT -6000000.0 -6000000.0 6000000.0 6000000.0
....
LAYER # BLUEMERBLE
NAME earth_2400
DATA 'earth_2400.tif'
PROCESSING "LOAD_WHOLE_IMAGE=YES"
PROCESSING "LOAD_FULL_RES_IMAGE=YES"
DEBUG on
PROCESSING "DITHER=YES"
STATUS default
TYPE raster
PROJECTION
#"init=epsg:4326"
"proj=latlong"
END
END
And the image: http://www.daisyred.it/share/tifforto.jpg
Thanks for your help..
Diego
On 9/6/05, Frank Warmerdam <fwarmerdam at gmail.com> wrote:
> On 9/1/05, Diego Savardi <diego.savardi at gmail.com> wrote:
> > Hi all,
> > I'm encountering some problems while trying to draw an entire image of the
> > world using orthogonal projection.
> > I use a lat-lon raster image derived from the nasa bluemarble and a
> > shapefile of the world countries as layers. I'm working with cgi-mapserver
> > 4.6 and also with java mapscript, and with both I have problems.
> > There's something wrong with the image boundary, it seems that mapserver
> > draw the raster only when the extent cross the image border, like it's
> > trying to maintain square the raster area.. it happens only for the raster,
> > the shapefile is drawn correctly (except from some points that fall in 0,0).
> > If I zoom in to fill all the image with the map everything works correctly,
> > on the other side if I zoom out just to see the entire globe there's no
> > raster image drawn, only the shapefile works.
> >
> > With the bluemarble layer I've tried to use also the processing parameters
> > LOAD_WHOLE_IMAGE=YES and LOAD_FULL_RES_IMAGE=YES with no results.
>
> Diego,
>
> I *suspect* that your processing parameters were not set properly somehow
> when generating the image you attached. They should ensure that the
> correct output is generated (at some potential cost in performance).
>
> I'm not sure what is going on with the vectors zooming to zero. That
> shouldn't happen if failed reprojections are being properly identified
> as they should in your case (I think).
>
> I would suggest isolating the problem with a simple mapfile and
> "shp2img". If you can, then pass it on to me and I'll dig in a bit
> deeper. It is possible that there are problems with setting the
> processing parameters from mapscript. If that is the case, we can
> dig into that aspect of the problem.
>
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush | Geospatial Programmer for Rent
>
More information about the MapServer-users
mailing list