Projection & raster questions

Stephen Davies sdc at SDC.COM.AU
Fri Dec 2 22:35:25 PST 2005


I have resolved this issue by rebuilding GEOS, GDAL and mapserv.

It now all works beautifully.

Cheers,
Stephen

On Thur, 1 Dec 2005 05:00 pm, you wrote:
> I have an application which is heavily based on the DHTML rubber band 
> sample in the MapServer tutorial. That is, it used two divs to present 
> a main map and a reference map with mapserv?mode=map commands.
> 
> (MapServer version 4.6.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
> OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER 
> SUPPORTS=GEOS INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS 
> INPUT=SHAPEFILE)
> 
> The data involved is stored in a PostGIS database as lat/long 
> coordinates and is (currently) projected into the map with proj=eqc 
> lon_0=xxx where xxx is calculated dynamically as the centre of the 
> initial map extent.
> 
> With the attached map1.map mapfile this works very well and users can 
> zoom, pan and query from the main map and pan from the reference map 
> with the correct results (though the area of interest square on the 
> reference map is sometimes marginally out - particularly for very 
small 
> map extents aganst relatively large reference maps).
> 
> The extent for the initial main map is given via the URL in the form:
> 
> 
&mapext=139.357482910156+-34.3308868408203+139.380233764648+-34.3129386901855
> 
> That is, long/lat (calculated dynamically from other input) and the 
> UNITS are meters.
> 
> The values plpl, exex and cidcid are edited to realvalues before 
> invoking mapserv. plpl is the calculated central meridian, cidcid is 
> the current user ID and exex is the extent of the reference map IN 
> METRES!
> 
> This latter extent is calculated from lat/long values using proj:
> 
> proj +proj=eqc +lon_0=$central (where $central is the same value as 
plpl 
> above)
> 
> As I say, the above all works exactly as I want - provided the above 
> projection and extent rules are followed.
> 
> However, I now want to add the raster layer and am having difficulty 
> getting the new layer to align with the rest.
> 
> The raster file is an ECW.
> 
> Driver: ECW/ERMapper Compressed Wavelets
> Size is 82560, 70380
> Coordinate System is:
> GEOGCS["GEOCENTRIC DATUM of AUSTRALIA",
>     DATUM["GDA94",
>         SPHEROID["GRS80",6378137,298.257222101]],
>     PRIMEM["Greenwich",0],
>     UNIT["degree",0.0174532925199433]]
> Origin = (112.500000,-8.903313)
> Pixel Size = (0.00050000,-0.00050000)
> Corner Coordinates:
> Upper Left  ( 112.5000000,  -8.9033134) (112d30'0.00"E,  8d54'11.93"S)
> Lower Left  ( 112.5000000, -44.0933134) (112d30'0.00"E, 44d 5'35.93"S)
> Upper Right ( 153.7800000,  -8.9033134) (153d46'48.00"E,  
8d54'11.93"S)
> Lower Right ( 153.7800000, -44.0933134) (153d46'48.00"E, 44d 
5'35.93"S)
> Center      ( 133.1400000, -26.4983134) (133d 8'24.00"E, 
26d29'53.93"S)
> Band 1 Block=82560x1 Type=Byte, ColorInterp=Red
>   Overviews: arbitrary
> Band 2 Block=82560x1 Type=Byte, ColorInterp=Green
>   Overviews: arbitrary
> Band 3 Block=82560x1 Type=Byte, ColorInterp=Blue
>   Overviews: arbitrary
> 
> To test the ECW raster facility, I created a test map file (attached 
as 
> map2.map).
> 
> The only ways that I could get the image displayed were to specify the 
> projection as epsq:4263 and the extent as lat/long or the projection 
as 
> eqc and the extent in meters relative to 0,0 at top left despite the 
> image georef stuff all being in lat/long (why is this??).
> 
> Neither of these combinations will work in the existing application 
(as 
> the rubber band and reference map interfaces require metres and a 
> proper geographic extent) so I went back to square one with that app 
> and tried again to specify the map extent in metres.
> I used proj to convert the lat/long extent into metres and tried to 
> generate a map. At first it looked as if the map was blank but then I 
> randomly panned around and discovered that the data was actually there 
> but off the map. Apparently, the extent values out of the proj command 
> differ quite significantly from the same values generated within 
> mapserv????
> 
> For example, proj gave me values of -1282.08, -3821696.8 & 
> 1250.54,-3819699 while mapserv gave -1336.4, -3802151 & 1351.1, 
> -3799464 for approximately the same piece of space.
> 
> So, I now have two problems:
> 1. how to calculate the correct extent values for the base app and
> 2. how to get the raster layer to align with the rest (that is with 
the 
> same extent as the rest rather than the 0,0-based one).
> 
> TIA,
> Stephen avies
> 
> -- 
> 
========================================================================
> This email is for the person(s) identified above, and is confidential 
to
> the sender and the person(s).  No one else is authorised to use or
> disseminate this email or its contents.
> 
> Stephen Davies Consulting                            Voice: 08-8177 
1595
> Adelaide, South Australia.                             Fax: 08-8177 
0133
> Computing & Network solutions.                       Mobile:0403 0405 
83
> 
> 
> 

-- 
========================================================================
This email is for the person(s) identified above, and is confidential to
the sender and the person(s).  No one else is authorised to use or
disseminate this email or its contents.

Stephen Davies Consulting                            Voice: 08-8177 1595
Adelaide, South Australia.                             Fax: 08-8177 0133
Computing & Network solutions.                       Mobile:0403 0405 83
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051203/aa6470ed/attachment.sig>


More information about the MapServer-users mailing list