[Mapserver-users] Proj problems

Gerry Creager N5JXS gerry.creager at tamu.edu
Fri Aug 1 09:17:42 EDT 2003


Vincent Schut wrote:
> Gerry,
> please if you reply, include the list. Others might want to follow our 
> discussion, maybe learn from it, correct me, or even add better ideas...

OK.  I'd seen projection problems discussed so often, I was sure I'd be 
boring the list with 'em.  However, from another perspective, if they 
are complex enough to stump a lot of folk, it's almost certainly worth 
keeping the discussion 'live'.

> There are a bunch of documents on the internet that say proj=longlat (google 
> for it, you'll be stumped!). I believe they are wrong... However, if it is in 
> the mapserver docs/wiki somewhere, we should track that down and have it 
> corrected.

I'll try to find the references...

> I see about the meteorologists being not gis people...
> I might have overlooked a main projection block.
> According to the gdal docs, the world file for your gif should be named .wld 
> (if your gif is radar.gif, your world file should be radar.wld). Then 
> mapserver (gdal) should automatically recognize it. .tfw means Tiff World 
> File, thus should be used for tiffs...

Good point.

> If it worked without reprojecting, adding a valid projection block into the 
> map block and accordingly changing the extent and eventually units should 
> suffice to get your output in a different projection. However, I would try to 
> start simple to get that working. The degree of confusion did not escape my 
> eye ;-) Once you got reprojection working with one layer, adding more layers 
> that previously worked should not be any problem.

I'll try incrementally, again.  I've been down that road, but correcting 
the 'longlat' error may cause different results.

> I am not a projection expert and certainly not Lambert, but a typical thing to 
> forget/do wrong might be to have an extent that does not fit the used 
> projection...

Theoretically, I understand projections.  I can discuss the process and 
teach it; I just can't seem to get it right in Mapserver!  Time for more 
study.

Thanks again!
gerry

> Well I hope you'll succeed somehow.
> Cheers,
> Vincent.
> 
> 
> On Friday 01 August 2003 13:42, Gerry Creager N5JXS wrote:
> 
>>Helps a lot.  Thanks!
>>
>>One note:  Somewhere in the docs or wiki, and I don't recall now, the
>>reference is to 'proj=longlat'... I recall seeing it and scratching my
>>head, but, well, documentation is documentation, and the folks who write
>>it are usually better informed than I am.. that's why I'm reading THEIR
>>docs!
>>
>>So: Let me go make some changes
>>
>>As for complexity, it works sans projection info, as I've gotten
>>everything into a geographic projection, but the presentation is
>>criticized since the tpical meteorologist inour parts believes that
>>nothing can be represented save in Lambert, and appaently the rain can't
>>fall nor the wind blow, unless all maps are thus represented.  So, I'm
>>trying to reproject.
>>
>>Oh, and I thought I DID have a main projection defined.  There are
>>several in there, and I thought I'd left one in place, active.  If not,
>>it's representative of the degree of confusion I've managed to create
>>for myself.
>>
>>Finally, there is a world file for the gif (tfw) as well as one for the
>>png (pngw).  Now I've got to figure out how to reference it.
>>
>>Thanks again.  These tips might get me on-track.
>>
>>Regards,
>>Gerry
>>
>>Vincent Schut wrote:
>>
>>>Gerry,
>>>
>>>I don't presume I will solve your problem, but let me add me 2 cents:
>>>
>>>- I saw a line 'proj=longlat'. This is definitely not going to work, as
>>>it should be 'proj=latlong'.
>>>- I think you can't use a full proj definition and a epsg:xxxx line
>>>together in the same projection block (in the PWV layer). An epsg line is
>>>a shortcut to a full projection definition. Either use that, or define
>>>the projection yourself in the projection block, but don't do both, cause
>>>you'll end up having 2 projections defined...
>>>- mind that layers that do not have a projection defined in the map file
>>>and do not have an internal projection definition (e.g geotiff files do,
>>>but shapefiles don't have an internal projection def) are assumed to be
>>>in the defined output projection of the mapfile. If they are not in the
>>>same projection, there is a pretty big chance that they will fall outside
>>>of your defined map extent.
>>>- your mapfile is quite complex, having some different layers with
>>>different projections. I'd say, try to start with a stripped down mapfile
>>>with only one layer which is in the same projection as the output
>>>projection, get that working, then start adding new layers one by one.
>>>This greatly increases your chances of tackling the problem. Now it can
>>>be anywhere in your file. - it might be on purpose but the mapfile you
>>>attached doesn't have any main map projection defined: they are all
>>>commented out. Don't forget to uncomment one, as you will need at least
>>>one... And adjust the units according to the uncommented projection, e.g.
>>>if you uncomment a utm proj, change units to meters. And of course change
>>>your main extent accordingly.
>>>- remove the minscale and maxscale items from the web block while
>>>debugging to prevent them to fool you.
>>>- STATUS should be on|off|default, not false, according to the documents.
>>>I wonder why you don't get a parse error about that. Or it might work but
>>>be undocumented ;-) BTW while debugging I always prefer status default,
>>>because that makes sure your layers will be displayed, while with status
>>>on you will have to activate them explicitly in your cgi request. For
>>>more info on this search the mailing list archives.
>>>- for raster files that are not in some remote sensing format and thus do
>>>not contain any coordinate information (like the radar layer: it's a gif
>>>file) you probably need to use a world file to define the corner
>>>coordinates and raster cell size.
>>>
>>>Hope these help...
>>>Good luck,
>>>
>>>Vincent.
>>>
>>>On Thursday 31 July 2003 23:28, Gerry Creager wrote:
>>>
>>>>OK, I'm pretty much at my wits' end.  I've tried looking at this on a
>>>>time-available basis, and I'm just not getting it.
>>>>
>>>>A mapserv -v yields the following:
>>>>[root at mesonet cgi-bin]# ./mapserv -v
>>>>MapServer version 3.7 (development) OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>>>>OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER
>>>>SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=GD2_RGB INPUT=OGR
>>>>INPUT=GDAL INPUT=SHAPEFILE
>>>>
>>>>PROJ support is there, so it should allow me to specify a projection
>>>>section, either with the EPSG shortcut or the long way, with everything
>>>>specified.  I've tried that and what I end up with is essentially a
>>>>blank screen...
>>>>
>>>>If someone's got suggestions, great.  The mapfile is attached.  I'll
>>>>keep looking at it, but it's looking like my hair's on fire and I can't
>>>>get it put out...
>>>>
>>>>Thanks in advance,
>>>>Gerry
> 
> 

-- 
Gerry Creager -- gerry.creager at tamu.edu
Network Engineering -- AATLT, Texas A&M University	
Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.847.8578
Page: 979.228.0173
Office: 903A Eller Bldg, TAMU, College Station, TX 77843




More information about the mapserver-users mailing list