[mapserver-users] Σχετ: Mapserver can't read mapfile

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Jun 2 05:29:43 PDT 2014


Hi Stefanos,

Some comments:

- the best way to get the exact extent is to use the ogrinfo commandline
utility with the "-summary" switch:

  ogrinfo dasarxeia.shp dasarxeia -summary

- be careful with your SHAPEPATH, if your file is
/home/mapdata/data/dasarxeia.shp then I would put for your SHAPEPATH
"/home/mapdata/data/"

- when using shp2img, at the end of the command add "-all_debug 3" to
see more useful error messages/notices

- sometimes extent values in QGIS can be confusing, because sometimes it
can display the data in a different projection without you knowing it
(Project Properties/CRS/Enable 'on the fly' transformation)...so be careful


-jeff




-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 2014-06-01, 4:31 PM, Stefanos Anastasiou wrote:
> Hi Jeff,
> 
> I came to this old post once again and I tried the above mentioned.
> shp2img still produces an image which is blank or whatever the color of
> the mapfile is defined. On the other hand I checked the EXTENT once
> again and it was wrong so I changed to the appropriate one (EXTENT 17.00
> 33.00 32.00 42.00) which I checked on QGIS in WGS84 so it should be
> fine. If STATUS is set to default or On there's no difference. I also
> changed TYPE to line and polygon just to be sure but nothing. 
> 
> My shapefile is a polygon with boundaries.  Why wouldn't it appear on
> the browser?
> 
> Thanks again and I'm sorry for writing about it so late.
> 
> Stefanos
> 
> 
> Στις 7:15 μ.μ. Δευτέρα, 10 Φεβρουαρίου 2014, ο/η Jeff McKenna
> <jmckenna at gatewaygeomatics.com> έγραψε:
> 
> 
> Hi sorry long thread and I bet this has already been said, but here were
> my thoughts when I read your problems:
> 
> - always test your mapfile at the commandline first, using the shp2img
> utility (http://mapserver.org/utilities/shp2img.html).  Once your layers
> look find there in the generated map image then move to your application
> 
> - if using MapServer CGI (mode=map), a blank map often means you are not
> specifically telling MapServer to turn on layers; try adding &LAYERS=all
> 
> - or setting each of your layer's STATUS values to DEFAULT might work
> (but this can cause lots of trouble later, so this is not often recommended)
> 
> -jeff
> 
> 
> 
> -- 
> Jeff McKenna
> MapServer Consulting and Training Services
> http://www.gatewaygeomatics.com/
> 
> 
> 
> On 2/10/2014, 11:15 AM, Stefanos Anastasiou wrote:
>> Hello!!
>>
>> I'am having my mapfile place in /home/mapdata folder whereas I also keep
>> a couple of other mapfiles too.
>> I'm trying to load it in the following form on the
>> browser:
> http://127.0.0.1/cgi-bin/mapserv?map=/home/mapdata/pelop.map&mode=map
>>
>> and all I get is a blank page. No errors no nothing.
>>
>> Then I created an html template in order to click it from there by
>> creating a simple link (and not a from) in the following hyperlink:  <a
>>
> href="http://127.0.0.1/cgi-bin/mapserv?map=/home/mapdata/pelop/map&mode=map>
>> This link </a>
>>
>> And I get the following error: msLoadMap(): Unable to access file. 
>>
>> Last time this happened I was invoking Mapserver through a form but this
>> time it's just a simple link.
>>
>> Why is it happening ?
>>
>> The weird thing is that all the other mapfiles that are seem to be
>> working are are having the same permission settings with the
>> current: -rw-r--r--
>>
>> Thanks a lot!
> 
>>
>>




More information about the mapserver-users mailing list