Data Plotted at Wrong Location
Tran, Toan (MCYS)
Toan.Tran at ONTARIO.CA
Wed Dec 12 12:06:38 PST 2007
Brent, David,
Thank you so much for your help so far.
Sorry for the long email....
As mentioned by David, setting:
CONFIG "PROJ_LIB" "/usr/local/share/proj" OR
CONFIG "PROJ_LIB" "/usr/local/share/proj/nad"
in the .map doesn't seem to work....
I didn't see a "nad" directory in /usr/local/share/proj
All files including epsg are in /usr/local/share/proj
I tried creating a "nad" directory in /usr/local/share/proj and copy all
the files into "nad" like in Windows (C:\ms4w\proj and
C:\ms4w\proj\nad). This doesn't help.
Setting chmod 777 * to all these file doesn't work either.
Copying the same file to the same directory with uppercase (i.e. epsg to
EPSG) also doen'st work.
I have check my EXTENT using both ogrinfo and cs2cs.
I don't think the EXTENT is an issue, since I normally zoom/pan the map
to look for the data.
When I test PROJ4 using the proj and cs2cs utility, I did:
# cs2cs +init=epsg:4269 +to +init=epsg:42304 or cs2cs +init=epsg:4326
+to +init=epsg:42304
-95 49 [input]
0.00 0.00 0.00 [output]
-95 49 [input]
0.00 0.00 0.00 [output]
-89.258496 48.402453 [input: Thunder Bay]
425456.38 -47590.64 [output]
Double checking:
# cs2cs +init=epsg:42304 +to +init=epsg:4269
425456.38 -47590.64 [input]
89d15'36"W 48d24'N 0.000 [output]
The convesrion is correct and I was able to see the Thunder Bay plotted
at the proper location
using (425456.38,-47590.64) with this in my config.map file:
#DATA: (425456.38,-47590.64)
#MAP LEVEL [Output Projection]
PROJECTION
"init=EPSG:42304"
END
#LAYER LEVEL [Input Projection]
PROJECTION
"init=EPSG:42304"
END
The problem is that it still can't plot data in geocode (lat,long).
This will not work (Cannot see Thunder Bay):
#DATA: (-89.258496 48.40245)
#MAP LEVEL [Output Projection]
PROJECTION
"init=EPSG:42304"
END
#LAYER LEVEL [Input Projection]
PROJECTION
"init=EPSG:4269"
END
It seems that it only work if I used init=epsg:42304 (proj=lcc).
I cannot find the data in the map when using init=epsg:4269 or
init=epsg:4326
Testing PROJ, I notice:
#proj +proj=lcc --> Can enter input
But...
# proj +proj=longlat OR proj +proj=latlong --> error message
Rel. 4.5.0, 22 Oct 2006
<proj>:
+proj=latlong unsuitable for use with proj program.
program abnormally terminated
Why is it that init=epsg:4269 or init=epsg:4326 doesn't work?
I check these value in the epsg file:
# NAD83
<4269> +proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs no_defs <>
# WGS 84
<4326> +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs no_defs <>
Something I am doing wrong?
Thanks
Toan
-----Original Message-----
From: Brent Fraser [mailto:bfraser at geoanalytic.com]
Sent: December 11, 2007 10:40 AM
To: Tran, Toan (MCYS); MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Data Plotted at Wrong Location
Toan,
Well it's a good first step. You need to now test Proj
with your epsg file (to confirm Proj can file and load the
epsg file) and your coordinates (to confirm your EXTENT is
set to cover the project coordinates).
PROJ_LIB needs to be set to something like /usr/local/share/proj/nad
(notice the nad at the end). This is the directory containing your
"epsg" file.
Then you need to test Proj with your EPSG coordinate
definition and valid coordinates using Proj's cs2cs command:
cs2cs +init=epsg:4326 +to +init=epsg:42304
-79 44
and compare the result to your EXTENTS.
Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta
----- Original Message -----
From: "Tran, Toan (MCYS)" <Toan.Tran at ONTARIO.CA>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Tuesday, December 11, 2007 7:58 AM
Subject: Re: [UMN_MAPSERVER-USERS] Data Plotted at Wrong Location
Hi Brent,
Yeah... I was shuffling the X and Y around to see if it make
a
different, but either combination doesn't seem to work.
I check the PROJ_LIB environment variable, it wasn't set. Setting the
variable in Solaris and Apache to /usr/local/share/proj doesn't seem to
work.
Executing:
# proj +proj=lcc
79.725 43.715 (input)
5619844.75 7781484.62 (output)
43.715 79.725 (input)
1266934.34 10025427.15 (output)
Does that confirm Proj4 is working correctly?
I been stuck here for awhile...
This going to haunt me if I can't figure out what's wrong...
Thanks a lot
Toan
-----Original Message-----
From: Brent Fraser [mailto:bfraser at geoanalytic.com]
Sent: December 10, 2007 3:26 PM
To: Tran, Toan (MCYS); MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Data Plotted at Wrong Location
Toan,
In your connection string you've got: x='Y' y='X'. Try changing it to
x='X' y='Y'. Although I don't know why it would work on Windows but not
Solaris.
You may want to confirm your Proj installation is working correctly on
Solaris by converting a few coordinates using the proj command on the
Solaris command line. I think you may need to ensure the PROJ_LIB
environment variable is set to the location of the Proj epsg file.
Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta
----- Original Message -----
From: "Tran, Toan (MCYS)" <Toan.Tran at ONTARIO.CA>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Monday, December 10, 2007 12:57 PM
Subject: Re: [UMN_MAPSERVER-USERS] Data Plotted at Wrong Location
Hi Brent,
I have include the config.map and the .csv file
I have thought if EXTENT could be an issue, but modifying
the minX,
minY, maxX, maxY doesn't seem to have any effect.
Those large number in the .csv file are added because I
wanted to test
the plotted points...
One thing that I find very puzzling is that we have tried
the map-server
using two different platform:
- Windows XP
- Solaris SPARC / UNIX
Both platform use almost the exact config.map file and .csv file But for
some reason, we did not have any problem on the Window Platform... All
the points are plotted with little trouble... but then again, in Windows
the map-server was package very nicely in a binary form.
Also, I pay very close attention so case-sensitive issues
(i.e. epsg
V.S. EPSG). Could the problem be some other case sensitivity issue in
Soalris/UNIX?
Thank you so much for your help so far.
Much appreciated
Toan
-----Original Message-----
From: Brent Fraser [mailto:bfraser at geoanalytic.com]
Sent: December 10, 2007 2:26 PM
To: Tran, Toan (MCYS); MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Data Plotted at Wrong Location
Toan,
Looking at the snippet of the csv file you provided below, you've got
some coordinates in a Geographic (decimal degrees of latitude and
longitude) and some in a projected system (meters LCC?). Mapserver
usually allows only one coordinate system definition per input file, so
this is not valid. They need to be all Geographic coordinates or all
projected.
And check your extents in the map file. Would they cover
the points in the csv file? It might be helpful if you included your
map file.
Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta
----- Original Message -----
From: "Tran, Toan (MCYS)" <Toan.Tran at ONTARIO.CA>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Monday, December 10, 2007 11:51 AM
Subject: Re: [UMN_MAPSERVER-USERS] Data Plotted at Wrong Location
Brent,
Thank you for your help. I am new to Map Server...
I have:
PROJECTION
"init=epsg:42304"
END
inside both my top-level MAP and LAYER definition.
I try Adding/Changing (Is this what your meant?) inside my Layer
definition... All the points that as plotted before are now gone.
PROJECTION "init=epsg:4269" END
The proper location is still not plotted.
Something I am doing incorrectly?
Thank you so much for your help.
Toan
-----Original Message-----
From: Brent Fraser [mailto:bfraser at geoanalytic.com]
Sent: December 10, 2007 1:33 PM
To: Tran, Toan (MCYS); MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Data Plotted at Wrong Location
Toan,
You haven't specified the coordinate system of the input
data so MapServer assumes it's the same as the coordinate system for the
output map (LCC).
Add a PROJECTION object to the csv file's LAYER
definition. For example, if the input data in the csv file
is NAD83:
LAYER csv
PROJECTION
"init=epsg:4269"
END
:
Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta
----- Original Message -----
From: "Tran, Toan (MCYS)" <Toan.Tran at ONTARIO.CA>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Monday, December 10, 2007 11:13 AM
Subject: [UMN_MAPSERVER-USERS] Data Plotted at Wrong
Location
Hi,
I wish to plot several points in Ontario, Canada, but the problem is
that the points are plotted at the wrong location. My data are in
decimal degree stored in a CSV file. But when the map was draw, all the
points are plotted very closed together. I suspect that for some reason,
the map-server is plotting the data as meter/or any other unit instead
of degree decimal. I used this PROJECTION in both my top-level MAP and
proper layer, with UNITS METERS: PROJECTION "init=epsg:42304" END I
added this for the /usr/local/share/proj/epsg file because it wasn't
there after I installed the Projection Library: <42304>
+proj=lcc
+lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95
+x_0=0 +y_0=0
+ellps=GRS80 +datum=NAD83 +units=m +no_defs no_defs <>
Is it enough to simple add the above epsg code???
Changing UNITS METERS to UNITS DD in my map file doesn't
help either.
Here are some sample DATA:
<<img.GIF>>
Desc,,X,Y
"5",79.725833,43.715361
"6",81.000107,43.368512
"7",-78.347276,44.301459
"8",,81.332038,48.47381
"9",79.68955,43.4662
...
"AAAAAAAAAAAAAAAAAAAAAAaaaaaa19",0,200000
"AAAAAAAAAAAAAAAAAAAAAAaaaaaa20",0,220000
"AAAAAAAAAAAAAAAAAAAAAAaaaaaa21",0,240000
"AAAAAAAAAAAAAAAAAAAAAAaaaaaa30",0,300000
"AAAAAAAAAAAAAAAAAAAAAAaaaaaa31",10000,300000
This is what I see when I type ./mapserv -v
MapServer version 4.10.3 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=OGR INPUT=GDAL
INPUT=SHAPEFILE DEBUG=MSDEBUG Any help is much appreciated Thanks Toan
More information about the MapServer-users
mailing list