[mapserver-users] map file with connection to postgis

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed Jan 7 08:54:12 PST 2015


It could also be your extents:

- remove all layers from your mapfile, except for the PG one
- remove all projection blocks from your mapfile
- connect through ogrinfo commandline to that layer

   ogrinfo PG:"host=127.0.0.1 user=postgres password=postgres 
dbname=test port=5432"

- use the ogrinfo command with the layername and the -summary switch to 
get the PG layer's extents

  ogrinfo PG:"host=127.0.0.1 user=postgres password=postgres dbname=test 
port=5432" yourPGlayername -summary

- use that extent for the EXTENT parameter in your mapfile
- re-test with shp2img command

   shp2img -m postgis.map -o ttt.png -map_debug 3


-jeff



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






On 2015-01-07 12:40 PM, Lime, Steve D (MNIT) wrote:
> If you get an image then at least no error is being generated. Are you
> sure the layer you’re trying to view is on? There’s a switch in shp2img
> to turn on a layer or you can set STATUS DEFAULT in the layer definition.
>
> Steve
>
> *From:*mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] *On Behalf Of
> *geo.graefin at web.de
> *Sent:* Wednesday, January 07, 2015 10:27 AM
> *To:* jt at mapmedia.de; mapserver-users at lists.osgeo.org
> *Subject:* Re: [mapserver-users] map file with connection to postgis
>
> Hello Jörg,
>
> I get an empty picture when I create a png with the tool shp2img.
>
> Thanks for helping!
>
> *Gesendet:* Mittwoch, 07. Januar 2015 um 16:44 Uhr
> *Von:* "Jörg Thomsen" <jt at mapmedia.de <mailto:jt at mapmedia.de>>
> *An:* mapserver-users at lists.osgeo.org
> <mailto:mapserver-users at lists.osgeo.org>
> *Betreff:* Re: [mapserver-users] map file with connection to postgis
>
> Hi,
>
> Am 07.01.2015 um 16:33 schrieb geo.graefin at web.de
> <mailto:geo.graefin at web.de>:
>> When I leave out "schema=public" in the string of "DATA" in my map file
>> then i get the following message:
>>
>> ëPNG
>>>> IHDR♥Þ♥Þ☺♥wmFº♥PLTE ºz=┌☺tRNS @µÏf æIDATx£Ý┴1☺┬á§Om
>>>> ¥♠ý? ☺°1ù! IEND«B`é
>
> looks like this is a png-image. Have you tried to open this file with an
> image-viewer?
>
> Jörg





More information about the mapserver-users mailing list