[Chameleon] No Query Results for Postgis layer

David Dabney David.Dabney at noaa.gov
Mon Feb 14 14:32:28 EST 2005


Paul,

I figured out the source of the problem.  The table that I had spatially 
enabled had a varchar(3) primary key.  For some reason pulling 
attributes back in chameleon didn't work with this.  I added a unique 
bigint field and now it works fine. 

So with the varchar primary key, the points and symbols were being 
displayed on the map, but the attributes wouldn't get pulled back into 
the array.

Thanks for your help,

Dave

Paul Spencer wrote:

> David,
>
> David Dabney wrote:
>
>> Paul,
>>
>> No worries on your response time.  Do you have any ideas on why 
>> mapserver/script would not pull back results?  I agree that it must 
>> not be a Chameleon issue.  Please excuse my ignorance, but what do 
>> you mean when you say 'check to make sure the loader put attributes 
>> into postgis?'
>
>
> does your postgresql table have the attribute data/columns that you 
> are expecting to get as a result of the query?
>
>>
>> Thanks,
>>
>> Dave
>>
>> Paul Spencer wrote:
>>
>>> David,
>>>
>>> this response is terribly late, but perhaps better late than never?  
>>> We have had no problems using postgis layers and getting query 
>>> results from them that include all the attributes defined in the SQL 
>>> of the DATA.
>>>
>>> Your layer seems to have all the necessary mapscript pieces (ON, 
>>> template, tolerance etc).
>>>
>>> shape_index, tile_index and layer_index are actually added by 
>>> Chameleon.  That probably means that none of the attributes are 
>>> being returned by mapscript to Chameleon.  I will assume that you 
>>> did check to make sure that the loader put the attributes into 
>>> postgis :> in which case, I really don't have an answer for you, 
>>> except that we have managed to get this working.
>>>
>>> Cheers
>>>
>>> Paul
>>>
>>>
>>> David Dabney wrote:
>>>
>>>> I am using Chameleon 2.0 and am trying to query a Postgis layer 
>>>> with the Query Widget.  For some reason only shape_index, 
>>>> tile_index, and layer_index are the only features returned.  I used 
>>>> pgsql2shp and the queries work fine for this layer pointing to the 
>>>> shapefile.  Any help would be greatly appreciated.
>>>>
>>>> Here are my layers:
>>>>
>>>> LAYER
>>>>  NAME stations
>>>>  METADATA
>>>>    "wms_title" "Stations Shape"
>>>>    "wfs_title" "Stations Shape"
>>>>  END
>>>>  TYPE POINT
>>>>  STATUS ON
>>>>  DATA stations
>>>>  CLASS
>>>>            SYMBOL star
>>>>            COLOR 0 0 0
>>>>            SIZE 7
>>>>  END
>>>>  TEMPLATE "ttt_query.html"
>>>>  TOLERANCE 10
>>>>  TOLERANCEUNITS pixels
>>>>  PROJECTION
>>>>      "proj=latlong"
>>>>      "datum=WGS84"
>>>>  END
>>>>
>>>> END # layer
>>>>
>>>> LAYER
>>>>      CONNECTIONTYPE postgis
>>>>      NAME "luces_stations"
>>>>      CONNECTION "user=****** dbname=****** host=******** port=5432"
>>>>      DATA "lat_long from (select * from stations) as s using unique 
>>>> station_code using SRID=26917"
>>>>      #FILTER "station = 'Middle'"
>>>>      METADATA
>>>>          "wms_title" "Stations PostGIS"
>>>>          "wfs_title" "Stations PostGIS"
>>>>      END
>>>>      STATUS ON
>>>>      DUMP TRUE
>>>>      TYPE POINT
>>>>      PROJECTION
>>>>          "proj=latlong"
>>>>          #"init=epsg:4269"
>>>>          "datum=WGS84"
>>>>      END
>>>>      TEMPLATE "ttt"
>>>>      TOLERANCE 10
>>>>      TOLERANCEUNITS pixels
>>>>      LABELITEM "station"
>>>>      CLASS
>>>>        TEMPLATE "ttt"
>>>>        SYMBOL star
>>>>        COLOR 0 0 0
>>>>        SIZE 7
>>>>      END
>>>> END
>>>>
>>>
>>
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~
David Dabney
NOAA Hollings Marine Lab/JHT
331 Fort Johnson Rd
Charleston, SC 29412
843.762.8984
david.dabney at noaa.gov



More information about the Chameleon mailing list