Shapefile questions

Lowell Filak lfilak at MEDINACO.ORG
Fri Oct 1 08:42:44 EDT 2004


The following message was sent by Sandeep Bashyal <gis at UNDPHAIS.ORG.NP>
on Fri, 1 Oct 2004 10:35:33 +0545.

> Hello,
>
> I have the following questions about shapefiles and mapserver:
>
> 1. Does Mapserver support "merged" polygons in shapefiles? E.g. arcview
> allows you to merge two or more NON-ADJACENT polygons, such that they are
> treated as a single shape and point to the same rows in the attribute
> table. I was wondering if mapserver supports such shapefiles with  merged
> non-adjacent polygons.
>
> 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 dnamically
> 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.
>
> Any advice on an easy way to write shapeindexes into a field in the
> attribute table would also be helpful.
>
> Thanks in advance.
>
> --
> Sandeep Bashyal

Sandeep,

I don't know about #1. I, think, technically because a shape is not
actually defined as a polygon it could actually be composed of many
polygons. However there are many on this list more qualified to answer this.
For #2. If the records in the attribute table you are trying to relate
have a 1:1 relationship with the shapes in the shapefile then you may be
able to add the shape index to the attribute table as a sequential
number If the attribute records are loaded in the same sequence as the
shapes occur. The more probable solution is have the ID as a field in
the DBF that is associated with the SHP file and use the shape index to
extract the ID from the DBF and then extract the attributes from the table.

HTH

Lowell



More information about the mapserver-users mailing list