[Chameleon] Cursorpos and ProjectionSelector problem

Normand Savard nsavard at mapgears.com
Fri Jan 8 13:53:08 EST 2010


Tony,

I wanted to know by reprojecting a single layer with ogr2ogr, if you 
were going to have the expected values for the coordinates of the 
features on the layer.  This would have allowed me to verify if this 
problem really appears in Chameleon.  I notice that by providing the 
additional explanation in your email below, you tested in within another 
software and this one outputs the correct result.

Norm

Tony Baylis wrote:
> I'm a bit confused as to your question.  All the data apart from 2 
> ecw's has been loaded into PostGIS using ogr2ogr using the base 
> datum/projection of the table, in this case AMG66 Zone 54.  The 
> mapfile has the following projection tag for AMG66 Zone 54:
>
> PROJECTION
>   "init=epsg:20254"
> END
>
> When Iooking at the same point in my web app and my desktop GIS I get 
> the same (correct) coordinates when using the default projection.  If 
> I change the projection (using the ProjectionSelector widget on the 
> web app and whatever means on my desktop app) to a lat/long projection 
> using the same datum (AGD66) the lat/longs are the same and correct. 
>  However when I change the projection to one using a different datum 
> the coordinate numbers on the web app DO NOT change.  It seems as if 
> the datum is not being picked up in the projection change.  Could this 
> be a problem in proj?   This I would doubt!
>
> Below is my mapfile minus a couple of thematic mappings for brevity.
>
> Tony
>
> #
> # Start of map file
> #
> MAP
>   NAME frieda_river
>   STATUS ON
>   SIZE 800 500
>   EXTENT 564300 9470937 599600 9493000
>   UNITS METERS
>   SHAPEPATH "/opt/FriedaRiver/"
>   IMAGECOLOR 237 255 208
>   SYMBOLSET "/opt/testwww/htdocs/includes/symbols.sym"
>   FONTSET "/usr/share/fonts/truetype/font.list"
>   DEBUG 2
>   CONFIG "MS_ERRORFILE" "/opt/testwww/wms_error/ms_error.txt"
>
> OUTPUTFORMAT
>   NAME "AGGA"
>   MIMETYPE "image/png"
>   DRIVER "AGG/PNG"
>   EXTENSION "png"
>   IMAGEMODE RGBA
>   TRANSPARENT ON
> END
>   
> #
> # Start of web interface definition
> # 
> WEB
>
>       IMAGEPATH "/opt/testwww/ms_tmp/"
>       IMAGEURL "/ms_tmp/"
>  END
>
> #
> # Assign Projection
> #
> PROJECTION
>   "init=epsg:20254"
> END
>   
> #
> # Start of legend
> #
> LEGEND
>   KEYSIZE 18 12
>   LABEL
>     TYPE BITMAP
>     SIZE MEDIUM
>     COLOR 0 0 89
>   END
>   STATUS ON
> END
>   
> #
> #Query definition
> #
> QUERYMAP
>   COLOR 255 0 0
>   STATUS ON
>   STYLE HILITE
> END
>
> LAYER
>   NAME "Topography"
>   TYPE RASTER
>   STATUS ON
>   CONNECTIONTYPE WMS
>   CONNECTION 'http://www2.demis.nl/WMS/wms.ashx?wms=WorldMap&amp 
> <http://www2.demis.nl/WMS/wms.ashx?wms=WorldMap&amp>;'
>   METADATA
>     "wms_srs" "EPSG:4326"
>     "wms_name"  "Bathymetry,Topography,Hillshading,Coastlines"
>     "wms_title" "Topography"
>     "wms_server_version"  "1.1.1"
>     "wms_format"  "image/png"
>     "legend" "-1"
>   END
> END
>     
> LAYER
>   NAME "May 100k Topo"
>   TYPE RASTER
>   STATUS OFF
>   DATA geography/imagery/may100k_rectified_AGD66Z54.ecw
>   METADATA
>       SOURCE "METADATA:  May 1:100,000 topographic map, scanned and 
> rectified by REM"
>   END
> END
>     
> LAYER
>   NAME "Stolle 100k Topo"
>   TYPE RASTER
>   STATUS OFF
>   DATA geography/imagery/stolle100k_rectified_AGD66Z54.ecw
>   METADATA
>       SOURCE "METADATA:  May 1:100,000 topographic map, scanned and 
> rectified by REM"
>   END
> END
>
> LAYER
>     GROUP "Geology"
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=rtcp 
> password=umapr_rtcp"
>     NAME "Geology 1:5000"
>     DATA  "wkb_geometry FROM geology5kamg66 using unique ogc_fid"
>     METADATA
>       SOURCE "METADATA:  Supplied by Xstrata 2003"
>     END
>     TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
>     STATUS OFF
>     TYPE POLYGON
>     LABELITEM "attribute"
>     CLASSITEM "attribute"      
>     CLASS
>       EXPRESSION "Kdp"
>       NAME "Kdp"
>       STYLE
>          COLOR 255 144 144
>       END
>     END      
>     CLASS
>       EXPRESSION "A"
>       NAME "A"
>       STYLE
>          COLOR 255 255 176
>       END
>     END      
>     CLASS
>       EXPRESSION "Au"
>       NAME "Au"
>       STYLE
>          COLOR 168 80 255
>       END
>     END               
> END
>
> LAYER
>     GROUP "Geology"
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=rtcp 
> password=umapr_rtcp"
>     NAME "Structure 1:5000"
>     DATA  "wkb_geometry FROM structures5kamg66 using unique ogc_fid"
>     METADATA
>       SOURCE "METADATA:  Supplied by Xstrata 2003"
>     END
>     TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
>     STATUS OFF
>     TYPE LINE      
>     CLASS
>       STYLE
>          COLOR 255 0 0
>          WIDTH 2        
>       END
>     END    
> END
>
> LAYER
>     GROUP "Geography"
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=rtcp 
> password=umapr_rtcp"
>     NAME "Rivers"
>     DATA  "wkb_geometry FROM png_riversamg66z54 using unique ogc_fid"
>     METADATA
>       SOURCE "METADATA:  Supplied by Xstrata 2003"
>     END
>     TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
>     STATUS ON
>     TYPE LINE
>     LABELITEM "name"     
>     CLASS
>       STYLE
>         SYMBOL "minor towns"
>         COLOR 50 100 255
>         SIZE 1
>       END
>       LABEL
>         ANGLE FOLLOW
>         MINDISTANCE 200
>         FONT ArialItalic
>         TYPE TRUETYPE
>         SIZE 8
>         COLOR 50 100 255
>         OUTLINECOLOR 255 255 255
>         POSITION UC
>       END
>     END    
> END
>
> LAYER
>     GROUP "Geography"
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=rtcp 
> password=umapr_rtcp"
>     NAME "Detailed drainage"
>     DATA  "wkb_geometry FROM detailed_drainage using unique ogc_fid"
>     METADATA
>       SOURCE "METADATA:  Supplied by Xstrata 2003"
>     END
>     STATUS OFF
>     TYPE LINE     
>     CLASS
>       STYLE
>         SYMBOL "minor towns"
>         COLOR 50 100 255
>         SIZE 1
>       END
>     END
> END
>
> LAYER
>     GROUP "Tenement"
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=rtcp 
> password=umapr_rtcp"
>     NAME "Tenement EL58"
>     DATA  "wkb_geometry FROM el58_agd66z54 using unique ogc_fid"
>     METADATA
>       SOURCE "METADATA:  Supplied by Xstrata 2003"
>     END
>     TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
>     STATUS ON
>     TYPE LINE
>     CLASS
>       STYLE
>          COLOR 0 0 0
>          WIDTH 3
>       END
>     END    
> END
>
> LAYER
>     GROUP "Clan Boundary"
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=rtcp 
> password=umapr_rtcp"
>     NAME "Clan Boundary"
>     DATA  "wkb_geometry FROM miningareaclanbdyamg66z54 using unique 
> ogc_fid"
>     METADATA
>       SOURCE "METADATA:  Supplied by Xstrata 2003"
>     END
>     TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
>     STATUS ON
>     TYPE LINE  
>     CLASS
>       STYLE
>          COLOR 255 128 0
>          WIDTH 4
>       END
>       STYLE
>         SYMBOL "linie-gestr4"
>          COLOR 0 0 0
>          WIDTH 2
>       END
>     END    
> END
>
> LAYER
>     GROUP "Geography"
>     CONNECTIONTYPE postgis
>     CONNECTION "host=localhost port=5432 dbname=FriedaRiver user=rtcp 
> password=umapr_rtcp"
>     NAME "Western Villages"
>     DATA  "wkb_geometry FROM westernhvillagesamg66z54 using unique 
> ogc_fid"
>     METADATA
>       SOURCE "METADATA:  Supplied by Xstrata 2003"
>     END
>     TEMPLATE "/var/www/chameleon/widgets/Query/QueryResults.phtml"
>     STATUS ON
>     TYPE POINT
>     LABELITEM "name"  
>     CLASS
>       STYLE
>         SYMBOL "minor towns"
>         OUTLINECOLOR 0 0 0
>         COLOR 255 0 0
>         SIZE 6
>       END
>       LABEL
>         ANGLE 0
>         FONT Arialbold
>         TYPE TRUETYPE
>         SIZE 8
>         COLOR 0 0 0
>         OUTLINECOLOR 255 255 255
>         SHADOWCOLOR 100 100 100
>         SHADOWSIZE 1 1
>         POSITION CR
>       END
>     END    
> END
>
> LAYER
>     NAME "Grid"
>     TYPE LINE
>     STATUS OFF
>     METADATA
>       SOURCE "METADATA:  Automatically created by the uMAP-R engine"
>     END
>     CLASS
>       NAME "Grid"
>       SYMBOL 'minor towns'
>       COLOR 200 200 200
>       SIZE 1
>       LABEL
>         FONT Arial
>         TYPE TRUETYPE
>         SIZE 7
>         COLOR 0 0 0
>         PARTIALS FALSE
>         OUTLINECOLOR 255 255 255
>       END
>     END
>     PROJECTION
>       "init=epsg:32751"
>     END
>     GRID
>       LABELFORMAT "DD" 
>       MINARCS 2
>       MAXARCS 3
>     END
> END
>   
> END
>
> On Fri, Jan 8, 2010 at 12:28 AM, Normand Savard <nsavard at mapgears.com 
> <mailto:nsavard at mapgears.com>> wrote:
>
>     Tony Baylis wrote:
>
>
>         I have noticed a problem with the return of coordinates using
>         CursorPos  when the projection of my map is changed using
>         ProjectionSelector and was wondering if there was a solution
>         out there.
>
>         I have client who wishes to view coordinates in both AMG66
>         Zone 54 and MGA94 Zone 54, the data being for northern
>         Australia.  The Easting should be a number about 138m higher
>         for the same point in MGA94 compared to AMG66.
>
>         The problem is that when I change the projection using
>         ProjectionSelector the Easting numbers are the same for the
>         the chosen point.  When I use a long/lat projection for both
>         datums (AGD66/GDA94) the same problem arises.  Have I missed
>         something?
>
>     Tony,
>
>     Do you get the same result when you reproject your data with
>     "ogr2ogr"?
>
>     Norm
>
>



More information about the Chameleon mailing list