Image location inside its corner coordinates
Bruno Patini Furtado
bpfurtado at GMAIL.COM
Thu Aug 10 07:50:50 PDT 2006
Hi Ed,
On 8/9/06, Ed McNierney <ed at topozone.com> wrote:
>
> Bruno -
>
> I would suggest not mixing problems at this point - let's not worry about
> ows_ metadata settings until you get the simple image display to work
> properly. Please leave out the METADATA statements until the image displays
> properly; then you'll be able to add the METADATA back in without being
> confused about what settings are helping and what settings are causing
> trouble.
>
My original motivation to adjust the ows_extent was to treat this problem
but following your advice e changing the units to decimal degrees my zoom
problem was solved, thanks a lot!
Yes, I suggested UNITS DD because your output and input image units are
> decimal degrees.
>
>
You should have EXTENT and UNITS statements at the top level in your map
> file,
>
and a PROJECTION block there, too (with the same settings as below, as you
> seem to want to display the image in its native unprojected coordinates).
> Is that the case? Can you post the whole map file?
>
I did not had a PROJECTION element other than the one in my LAYER element.
Now based on the lines bellow outputted by gdalinfo:
GEOGCS["WGS 84",
DATUM["WGS_1984",
I've created the following PROJECTION element:
PROJECTION
"proj=latlong"
"ellps=WGS84"
"datum=WGS84"
END
But I'm not sure if that's correct.
Here goes my hole mapfile (based on the mapserver demo Itasca mapfile):
MAP
NAME ITASCA
STATUS ON
SIZE 600 600
EXTENT -48.0004159 -25.0004164 -46.5004159 -24.0004163
UNITS DD
SHAPEPATH "data"
IMAGECOLOR 255 255 255
TEMPLATEPATTERN "itasca"
IMAGETYPE PNG
PROJECTION
"proj=latlong"
"ellps=WGS84"
"datum=WGS84"
END
#
# Start of web interface definition (including WMS enabling metadata)
#
WEB
HEADER templates/header.html
TEMPLATE "set in index.html"
FOOTER templates/footer.html
MINSCALE 1000
MAXSCALE 1550000
IMAGEPATH "set in index.html"
IMAGEURL "set in index.html"
METADATA
WMS_TITLE "UMN MapServer Itasca Demo"
WMS_ABSTRACT "This is a UMN MapServer application for Itasca
County located in north central Minnesota."
WMS_ACCESSCONSTRAINTS "none"
# change this value to match your setup
WMS_ONLINERESOURCE "http://10.10.5.171/cgi-bin/mapserv.exe"
WMS_SRS "EPSG:26915"
END
END
#
# Start of reference map
#
REFERENCE
IMAGE graphics/reference.png
EXTENT 324152.222 7384541.141 336175.222 7392179.141
SIZE 120 120
STATUS ON
MINBOXSIZE 5
MAXBOXSIZE 100
COLOR 255 0 0
OUTLINECOLOR 0 0 0
MARKERSIZE 8
MARKER 'star'
END
OUTPUTFORMAT
NAME GEOTIFFINT16
DRIVER "GDAL/GTiff"
MIMETYPE "image/tiff"
IMAGEMODE "INT16"
EXTENSION "tif"
END
LAYER
NAME "MyLayer"
STATUS OFF
TYPE RASTER
DUMP TRUE
DATA "SG-23-V-A.tif"
PROJECTION
"init=epsg:4326"
END
END
END
Are there other LAYER statements in the file?
>
No, I'm just trying with one at the moment for the sake of simplicity.
In fact I want to display a DEM (Digital Elevation Model) image through WCS
(Web Coverage Service) in order to open it in the OpenJUMP application (The
use of OpenJUMP is a mandatory requirement). For that I want first to test
the availability of WCS of this DEM in the MapServer Demo application.
That's my current strategy to achieve this objective, any suggestions would
be most appreciated :) (but I know, this can be a subject for a hole new
post to this list).
- Ed
>
>
> Ed McNierney
> President and Chief Mapmaker
> TopoZone.com / Maps a la carte, Inc.
> 73 Princeton Street, Suite 305
> North Chelmsford, MA 01863
> Phone: +1 (978) 251-4242
> Fax: +1 (978) 251-1396
> ed at topozone.com
>
> ------------------------------
> *From:* Bruno Patini Furtado [mailto:bpfurtado at gmail.com]
> *Sent:* Wednesday, August 09, 2006 1:47 PM
> *To:* Ed McNierney
> *Cc:* MAPSERVER-USERS at lists.umn.edu
> *Subject:* Re: [UMN_MAPSERVER-USERS] Image location inside its corner
> coordinates
>
> Hi Ed,
>
> On 8/9/06, Ed McNierney <ed at topozone.com> wrote:
> >
> > Bruno -
> >
> > Could you post the EXTENT statement you're using? Two things to check -
> > UNITS DD should be there (should not affect this problem, however) and your
> > EXTENT needs to be in the order MINX MINY MAXX MAXY, so it should be:
> > EXTENT -48.0004159 -25.0004164 -46.5004159 -24.0004163
> >
> My extent is indeed like you said it should be:
> EXTENT -48.0004159 -25.0004164 -46.5004159 -24.0004163
>
> It was because of the line below that you state that the units should be
> Decimal Degrees?
> UNIT["degree",0.0174532925199433],
>
> Your image is 1.5 degrees wide (X dimension) and 1 degree tall (Y
> > dimension) so your output image size should also be that shape (600 pixels
> > wide by 400 pixels high, for example) or you will see the map shrunk to fit
> > the shape of the image.
> >
>
> Your example shows the right proportion as gdalinfo tells the image is
> [1800, 1200] but I would like to set the layer metadata ows_extent with
> the actual image coordinates, not size, in order to show the image a bit
> better in the MapServer demo. Below goes my mapinfo layer element as I'm
> trying to configure it.
>
> LAYER
> NAME "my DEM Image"
> STATUS OFF
> TYPE RASTER
> DUMP TRUE
> DATA "SG-23-V-A.tif"
> PROJECTION
> "init=epsg:4326"
> END
> METADATA
> wcs_label "Some label"
> ows_extent "- 48.000416 -24.000416 -48.001816 -24.001816"
> wcs_resolution "0.00083 -0.00083"
> ows_srs "EPSG:4326"
> wcs_formats "GEOTIFFINT16"
> wcs_nativeformat "geotiff"
> END
> END
>
>
>
> - Ed
> >
> > Ed McNierney
> > President and Chief Mapmaker
> > TopoZone.com / Maps a la carte, Inc.
> > 73 Princeton Street, Suite 305
> > North Chelmsford, MA 01863
> > Phone: +1 (978) 251-4242
> > Fax: +1 (978) 251-1396
> > ed at topozone.com
> >
> > ------------------------------
> > *From:* UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]
> > *On Behalf Of *Bruno Patini Furtado
> > *Sent:* Wednesday, August 09, 2006 10:59 AM
> > *To:* MAPSERVER-USERS at LISTS.UMN.EDU
> > *Subject:* [UMN_MAPSERVER-USERS] Image location inside its corner
> > coordinates
> >
> > I have a DEM image of which below I've copied the gdalinfo output.
> >
> > Driver: GTiff/GeoTIFF
> > Size is 1800, 1200
> > Coordinate System is:
> > GEOGCS["WGS 84",
> > DATUM["WGS_1984",
> > SPHEROID["WGS 84",6378137,298.2572235630016,
> > AUTHORITY["EPSG","7030"]],
> > AUTHORITY["EPSG","6326"]],
> > PRIMEM["Greenwich",0],
> > UNIT["degree",0.0174532925199433],
> > AUTHORITY["EPSG","4326"]]
> > Origin = (-48.000416,-24.000416)
> > Pixel Size = (0.00083333,-0.00083333 )
> > Metadata:
> > AREA_OR_POINT=Area
> > TIFFTAG_SOFTWARE=IMAGINE TIFF Support
> > Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved
> > @(#)$RCSfile: etif.c $ $Revision: 1.10.1.9 $ $Date: 2003/11/13
> > 19:25:49EST $
> > TIFFTAG_XRESOLUTION=1
> > TIFFTAG_YRESOLUTION=1
> > TIFFTAG_RESOLUTIONUNIT=1 (unitless)
> > Corner Coordinates:
> > Upper Left ( -48.0004159, -24.0004163) ( 48d 0'1.50"W, 24d 0'1.50"S)
> > Lower Left ( -48.0004159, -25.0004164 ) ( 48d 0'1.50"W, 25d 0'1.50"S)
> > Upper Right ( -46.5004159, -24.0004163) ( 46d30'1.50"W, 24d 0'1.50"S)
> > Lower Right ( -46.5004159, -25.0004164) ( 46d30'1.50"W, 25d 0'1.50"S)
> > Center ( -47.2504159, -24.5004163) ( 47d15'1.50"W, 24d30'1.50"S)
> > Band 1 Block=1800x2 Type=UInt16, ColorInterp=Gray
> > Overviews: 450x300, 225x150, 113x75, 57x38
> >
> > I could take from it the EXTENT to use in my Mapfile using the Lower
> > Left and Upper Right coordinates. But the problem is that the image is
> > to small inside this coordinates and I can't find the image location inside
> > then by this output. Is there some other utility to get this coordinates?
> >
> >
> > --
> > "Minds are like parachutes, they work best when open."
> >
> > Bruno Patini Furtado
> > Software Developer
> > webpage: http://bpfurtado.net
> > software development blog: http://bpfurtado.livejournal.com
> >
>
>
>
> --
> "Minds are like parachutes, they work best when open."
>
> Bruno Patini Furtado
> Software Developer
> webpage: http://bpfurtado.net
> software development blog: http://bpfurtado.livejournal.com
>
--
"Minds are like parachutes, they work best when open."
Bruno Patini Furtado
Software Developer
webpage: http://bpfurtado.net
software development blog: http://bpfurtado.livejournal.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060810/d5df1141/attachment.htm>
More information about the MapServer-users
mailing list