queryByPoint accuracy/confusion

tim tibben at OCF.BERKELEY.EDU
Wed Oct 19 10:19:14 EDT 2005


This is just a follow up post regarding my confusion with the measurement 
tools when using the Standard Mercator projection.

After poking around in the source code for mapServer (particularly the 
parts using and distance calculations) it became obvious that mapServer 
uses cartesian coordinates within the framework of the projection for these 
purposes - hence when using a projection such as the Standard Mercator 
there will be distance measuring problems . . .

Since then I have found a fudge that works for my application, but it is 
just a hack in PHP mapScript that gives results close enough to what I need.

Since mapServer does not try to be a 'GIS' program perhaps this issue will 
never be addressed . . . I would still appreciate any thoughts on this 
issue . . .

thanks
tim

Tim Norris

At 02:36 PM 10/17/2005, Tim Norris wrote:
>Perhaps this is not the place for these questions and I should be posting
>this observation to the PROJ4 list . . . in any case input would be
>appreciated. Sorry in advance if this observation is out of place.
>
>So now that I have reminded myself that measuring distance on maps is a
>difficult matter, I have a further question regarding the distance measuring
>tools in mapServer (in particular with the use of the Mercator projection).
>
>After a little research, the problem regarding measuring distances when
>using the standard Mercator projection would be a variable issue based on
>lattitude. This is fairly obvious if we think about the way the Mercator
>projection works, and perhaps my best solution is to choose a better
>projection for my area of interest (California - perhaps a version of UTM
>would give me better measurments - in fact I am reasonably certain it would).
>
>But the big questions for me is - since there are errors within the distance
>measuring tools, do the same errors exist in the scalebar tools??
>
>After measuring a few scalebars and comparing them to paper maps of
>California it would seem that the answer is yes. All of the scalebars drawn
>through mapServer are short (using the Standard Mercator between lattitudes
>33 and 38).
>
>Even though the answer is that there is an error using distances with the
>Standard Mercator with my system, I am, to say the least, unclear as to
>where this problem lies . . . PROJ4 problem?? . . . a compile problem??  . .
>. a GDAL problem?? some other issue???
>
>I am sure that I can fudge a workaround for this, but at the same time . . .
>any guidance for an eleant solution would be greatly appreciated . . .
>
>for reference the following were my build steps:
>
>for Proj4
>[root at maps proj-4.4.9]# ./configure
>[root at maps proj-4.4.9]# make
>[root at maps proj-4.4.9]# make install
>
>[root at maps proj-4.4.9]# cp ~/epsg /usr/local/share/proj/epsg
>
>for GDAL
>[root at maps gdal-1.2.6]# make clean
>[root at maps gdal-1.2.6]# ./configure  --with-ogr --without-python --with-xerces
>[root at maps gdal-1.2.6]# make
>[root at maps gdal-1.2.6]# make install
>[root at maps gdal-1.2.6]# /sbin/ldconfig
>
>for mapserver
>[root at tuna mapserver4.4.2]# rm -f config.cache
>[root at tuna mapserver4.4.2]# ./configure --without-tiff --with-threads
>--with-proj --with-gdal=/usr/local/bin/gdal-config --with-ogr
>--with-php=../php-5.0.4 --with-gd=/usr/local  --with-freetype=/usr/bin
>--with-pdf --with-wmsclient --with-wfs --with-wfsclient
>[root at tuna mapserver4.4.2]# make clean
>[root at tuna mapserver4.4.2]# make
>[root at tuna mapserver4.4.2]# cp mapserv /var/www/cgi-bin/mapserv_40
>[root at tuna mapserver4.4.2]# cp mapscript/php3/php_mapscript.so
>/usr/local/php/extensions/php_mapscript_40.so
>
>as noted in the earlier post, I am using mapServer with PHP mapscript on a
>Fedora/apache system and all my data is MapInfo (through OGR) - other than
>this problem, mapServer has performed much better than commercial software
>that I have used in the past.
>
>thanks
>tim
>
>Tim Norris
>
>ps: this has also been posted to the PROJ4 listserv



More information about the mapserver-users mailing list