Exporting Shapefiles w/ DBF

Mevima Winn paulanne.winn at WACORP.NET
Thu Aug 23 18:13:53 EDT 2007


I've been working on getting a circular feature so I can search by a radius
around a point, and I believe I have it down - except that the shapefiles
I'm exporting don't include DBF files, which from my research is quite
important for MapServer do be able to read them.  I'm not sure whether I'm
even following the right path, so maybe someone can offer a suggestion.

This is a skeleton of the code I'm using (C#):

layerObj lyr=new layerObj(map);
//defining the layer...
shapeObj shp=new shapeObj((int)MS_SHAPE_TYPE.MS_SHAPE_POLYGON);
//adding points to the line and lines to the shape...
shapefileObj shpfile=new shapefileObj(path+"New.shp",5);
shpfile.add(shp);
shpfile.Dispose();
lyr.data="New.shp";

This works great, I can even open the shapefile it creates in Global Mapper,
until it gets to that last line... then it hangs and can't seem to load the
data.  After looking into the matter, it seems that I need a DBF file to go
with the SHP - it's creating SHP and SHX but nothing else.  However, I can't
figure out how to go about this.

Now, there's probably even a better way to get a circular feature than
creating an entirely new shapefile, writing a bounding box to it, and
reading the file as a circle layer - and I would like to know if there is! -
but even so, creating a shapefile that I can read from is probably going to
be vital in the future.  I'd be grateful for any input!

____________
Mevima Winn
Wireless Applications Corp.
111 108th Ave. NE.
Suite 160
Bellevue, WA 98004
*paulanne.winn at wacorp.net*
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.2/967 - Release Date: 8/22/2007
6:51 PM



More information about the mapserver-users mailing list