[mapserver-users] map scale questions

Bjarni Pjetursson Bjarni.Pjetursson at tietoenator.com
Tue Aug 6 07:08:13 EDT 2002


Hi Alex,

Quote from ftp://ftp.remotesensing.org/pub/proj/OF90-284.pdf

>> Program proj (release 3) is a standard Unix filter function which
converts geographic longitude and latitude coordinates into cartesian
coordinates <<

if your data source is in lon/lat, your coordinates are stored in degrees.
You should therefore set the Mapserver map file units to "DD" (decimal
degrees).

If your data is in any other projection, your coordinates are stored in
cartesian coordinates (for example m, km, mi). Theese coordinates are much
larger than decimal degrees. Most likely this is the reason you see the
weird scale. You must set your map file units to the appropriate cartesian
unit.

You can use freeware viewing tools like Geographic Explorer
(http://www.bluemarblegeo.com/products.asp?id=5) to display the actual
values in your data files.

Regards
Bjarni Thor Pjetursson

-----Original Message-----
From: Alex Rice
To: Ed McNierney
Cc: mapserver-users at lists.gis.umn.edu
Sent: 06-08-02 09:24
Subject: Re: [mapserver-users] map scale questions

Ed, thanks for your response. I've now got a Mapinfo layer 
generating a correct scalebar. Let me explain what I did. I'm 
still very much puzzled why the scale was getting broken in this 
particular case. Let me preface this with: I've only been using 
MapInfo for a few months and have no GIS experience before that.

On Monday, August 5, 2002, at 07:56  PM, Ed McNierney wrote:
>
> I'm not a MapInfo user, but what projection is your data stored in?  I

Some of the layers are from an unknown source, somewhere in the 
city government, and they are in US State Plane Coordinates 
(1983, Feet), New Mexico 3002, Central Zone. So I guess for these 
layers, the correct units are feet, actually "U.S Survey feet"?

Most of my other layers are ones my coworkers created in MapInfo. 
The projection for these layers is kinda weird. Mapinfo says the 
projection is "Longitude / Latitude". However, when I crack the 
TAB files open with ogrinfo, it says:

GEOGCS["unnamed",
     DATUM["MIF 0",
         SPHEROID["WGS 84 (MAPINFO Datum 0)",6378137.01,298.257223563],
         TOWGS84[0,0,0,0,0,0,0]],
     PRIMEM["Greenwich",0],
     UNIT["degree",0.0174532925199433]]

OK, again the above WKT is what MapInfo produces when the MapInfo 
app says the projection is "Longitude / Latitude".

> know you're not reprojecting the data, but are you correctly
expressing
> the measurements of your data files?  That is, an ESRI shapefile does
> not store units - coordinates are dimensionless numbers and you need
to
> tell MapServer what units they are in order to get things right.  If
> everything's the same, then by telling MapServer (in your MAP 
> section of
> the map file) that all source data units (and output data units) are
in
> miles.  Is this correct?

This is something I'm not clear on. Supposing one gets a 
shapefile or Mapinfo file from some unknown source. Does the 
projection information in the shapefile tell you what the "units" 
are? Supposing there is no WKT section, or it's not valid, then 
there is no way to know the units the features correspond to in 
the real world, and therefore the scale cannot be correctly 
calculated?

> MapInfo may also be misleading you when reporting that "1 in = 3 mi" -
> one inch on what?  On the screen?

I wish I knew :-) Somehow I ended up with printed manuals for 
ARC/Info instead of MapInfo. I need to find the full manuals for 
MapInfo.

> Sorry to have more questions than answers, and I feel like I'm 
> not being
> very clear here.  It's likely that several things are happening 
> at once.

Not at all. Thanks for talking me through this!

> Can you describe your source data in as much detail as possible
> (projection and units) and describe the MapInfo display you're 
> trying to
> replicate?  If there's anything we could look at online that 
> would help,
> as would some input from a MapInfo user!

Nothing online to view yet, however here is the situation:

In my infinite wisdom, to avoid using projections in mapserver, I 
thought OK I'll reproject everything in MapInfo to the simplest 
projection. I decided that "Longitude / Latitude" sounded better 
than "US State Plane". So I saved everything out as "Longitude / 
Latitude", and mapserver was then exhibiting the strange strange 
scales and scalebar I described earlier.

Just for kicks, just now I tried one of the original mapinfo TAB 
files, with the "US State Plane xxx" projection, and mapserver 
generates a good scale bar for that. Whew!

Compounding my confusion, I was trying some shapefiles I 
generated with MapInfo's "Universal Translator" utility. I 
discovered that this utility will convert Mapinfo TAB to ESRI 
Shape, but apparently throws out the projection info along the 
way. And then ogrinfo says:

Layer SRS WKT:
(unknown)

Anyways, I am sure I'm just missing some basic GIS concepts here, 
but why does mapserver break when I save the TAB files out as 
"Longitude / Latitude" instead of "US  State Plane xxx"?

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice at arc.to
alrice at swcp.com



More information about the mapserver-users mailing list