[MS4W-Users] mapserver not displaying postgis layers

Linnet Kwamboka scientific1quash at gmail.com
Mon May 17 06:40:05 EST 2010


IT WORKED,
i got  a really simple solution to this problem, in the selection bit add

USING UNIQUE gid USING SRID=-1

##the connection bit was

CONNECTION "user=xxx password=xxxx dbname=xxx host=xxx"

data "the_geom from table_name"


##so the new code will look like this

CONNECTION "user=xxx password=xxxx dbname=xxx host=xxx"
data "the_geom from table_name USING UNIQUE gid USING SRID=-1"

thanks again for looking into this, cheers!!



On Mon, May 17, 2010 at 1:22 AM, Linnet Kwamboka <scientific1quash at gmail.com
> wrote:

> hey Jeff,
> i managed to run the ogrinfo -al -sokenya_administrative.shp command but i
> get the following error,
>
>
> FAILURE:
> Unable to open datasource `E:\Ryan\solid_earth\thick18.ovf' with the
> following drivers.
>
>   -> ESRI Shapefile
>   -> UK .NTF
>   -> SDTS
>   -> TIGER
>   -> S57
>   -> MapInfo File
>   -> DGN
>   -> VRT
>   -> AVCBin
>   -> REC
>   -> Memory
>   -> CSV
>   -> GML
>
>
>   -> SQLite
>   -> ODBC
>   -> OGDI
>   -> PostgreSQL
>   -> FMEObjects Gateway
>
> how can this be solved? any ideas, anyone?
>
>
>
>
>
> On Sat, May 15, 2010 at 1:05 PM, Linnet Kwamboka <
> scientific1quash at gmail.com> wrote:
>
>> Thanks Jeff,
>> for the response, but am just not getting where do i run that ogrinfo
>> command? and there are like two different queries which do i run?
>>
>> >ogrinfo PG:"host=127.0.0.1 user=postgres password=postgres dbname=canada port=5432"
>>
>>       using driver `PostgreSQL' successful.
>>       1: province (Multi Polygon)
>>
>> or
>>
>> >ogrinfo --formats
>>   Loaded OGR Format Drivers:
>>   ...
>>   -> "PGeo" (readonly)
>>   -> "PostgreSQL" (read/write)
>>
>>
>>
>>   -> "MySQL" (read/write)
>>   ...
>>
>> i have only one layer-the postgis layer and i have removed the projection
>>
>>
>>
>> On Sat, May 15, 2010 at 11:49 AM, Jeff McKenna <
>> jmckenna at gatewaygeomatics.com> wrote:
>>
>>> Linnet Kwamboka wrote:
>>> > hey guys,
>>> > i have trouble displaying postgis layers on mapserver nothing at all
>>> > seems to work, any idea how i can change this, coz when i load directly
>>> > from  a shapefile, everything is ok, but not postgis, here is the code
>>> >
>>> >  LAYER
>>> >     NAME 'kenya_administrative'
>>> >     TYPE LINE
>>> >     CONNECTIONTYPE postgis
>>> >     CONNECTION "dbname='postgis-try' host=localhost port=5432
>>> > user='postgres' password='postgres'"
>>> >     DATA "the_geom FROM kenya_administrative"
>>> >     METADATA
>>> >       'wms_title' 'kenya_administrative'
>>> >     END
>>> >     STATUS OFF #when status in ON, its completely blank when off there
>>> > is a gray background
>>> >     TRANSPARENCY 100
>>> >     PROJECTION
>>> >     "init=epsg:31468"
>>> >
>>> >     END
>>> >     CLASS
>>> >        NAME 'kenya_administrative'
>>> >        STYLE
>>> >          SYMBOL 0
>>> >          SIZE 2
>>> >          OUTLINECOLOR 150 123 90
>>> >          COLOR 0 0 0
>>> >        END
>>> >     END
>>> >   END
>>> >
>>>
>>> Linnet,
>>>
>>> I recommend that you:
>>>
>>> - remove all other layers from your mapfile, so that there is only one
>>> layer (postgis layer)
>>> - remove all projection objects from your mapfile
>>> - use the ogrinfo command to get the extent of your postgis layer (see
>>> the example in http://www.mapserver.org/input/vector/postgis.html)
>>>   - use the extents returned from ogrinfo in your EXTENT parameter of
>>> your mapfile
>>> - retry using shp2img
>>>
>>> That should display your postgis layer.  If you make it that far, then
>>> you can worry about projection issues.
>>>
>>> -jeff
>>>
>>>
>>> ---
>>> Jeff McKenna
>>> MapServer Consulting and Training Services
>>> http://www.gatewaygeomatics.com/
>>>
>>>
>>> _______________________________________________
>>> MS4W-Users mailing list
>>> MS4W-Users at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/ms4w-users
>>>
>>
>>
>>
>> --
>> With regards,
>> Linnet Kwamboka
>>
>>
>>
>
>
>


-- 
With regards,
Linnet Kwamboka

+254725653165, +254733229041
site: geekmates.ning.com
blog: one-kenya.blogspot.com
skype: geekmate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20100517/cdfbaec3/attachment.htm 


More information about the MS4W-Users mailing list