[Shapelib] Example of how to create a shapefile

Frank Warmerdam warmerdam at pobox.com
Wed Mar 15 15:16:09 PST 2006


On 3/15/06, Kleymeyer, Alan <AKleymeyer at overwatch.com> wrote:

> which appears to create the .SHP & .SHX just fine.
>
> However ArcMap fails to load it reporting "Error opening feature class"
>
> I assume because I haven't created a .DBF file.
>
> What exactly do I need to write to the .DBF file?

Alan,

When I want to create a shapefile, but don't have any meaningful
attributes, I normally create a dbf file with one integer column that
I write an id to.   You can skim the dbfcreate and dbfadd programs
for a bit of an indication of how to use the dbf api.

Make sure you have one row in the dbf file for each shape object
created.

Best regards,


--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Shapelib mailing list