Shapefile questions

Sandeep Bashyal gis at UNDPHAIS.ORG.NP
Mon Oct 4 21:17:05 PDT 2004


On Tue, 05 Oct 2004 09:33:32 +0545, Sandeep Bashyal <gis at undphais.org.np>
wrote:

> On Fri, 1 Oct 2004 08:20:37 -0400, Stephen Woodbridge
> <woodbri at SWOODBRIDGE.COM> wrote:
>
>> Sandeep Bashyal wrote:
>
>>> 2. Is there a way to assign shapeindex for shapes in a layer from one
>>> of
>>> the fields in the attribute table (like in the mapfile or by
>>> dynamically
>>> adding a layer with phpmapscript)? I have a layer with over 4000
>>> polygons
>>> whose attribute ID's do not correspond to the shapeindex returned from
>>> query results. I need the attribute ID's to link to a external database
>>> and display results.
>>
>> You can access and attribute in a query and in fact I think you can do a
>> join of any attribute in a query result with and external database. Read
>> up on JOIN in the mapfile reference.
>
> Thanks for the help. I was initially thinking of using JOIN databases
> and displaying query results using templates. But the table I need to
> join to is a result of an sql query of a time series database and the
> table name changes depending on the sql query (eg.
> table_01_2004_05_2004). There was no reference in the phpmapscript
> reference to modifying the JOIN object of a map. So I will be using php
> for displaying all query results. For this I need an "ID" value from the
> dbf file of the shapefile. Presently I'm thinking of creating a table
> containing the shapeindex and the corresponding "ID" and extracting this
> ID using the shapeindex returned by query results. Is there an easier
> way to do this? Can I access dbf file attribute values from php without
> using templates?
>
> Thanks.
>

Please disregard the above post. I can get the ID using
$shape->values["ID"]. I should have read the docs more carefully. Thanks
for your help again.


--
Sandeep Bashyal
--
   National GIS Officer
   Humanitarian Assistance Information System (HAIS)
   United Nations (NEP/01/008)
   UN House, Pulchowk
   G.P.O. Box 107
   Kathmandu, Nepal
   Tel: (+977) 01 5543957
        (+977) 01 5554304
   Cell:(+977) 9841270854
   Fax: (+977) 01 5528059
--------------------------------------------------
mailto:gis at undphais.org.np
mailto:sandeep at earthmapping.com
http://www.undp.org.np



More information about the MapServer-users mailing list