[Shapelib] ESRI ArcMap reading problem

Brian Peschel brianp at occinc.com
Fri Feb 11 10:53:11 EST 2005


> > I am having a problem with ESRI's ArcMap reading the shapes I create.
> > It appears if ArcMap is taking the last point in a polygon and moving it
> > to coord (0,0) causing a spike in the object displayed.  The shpDump
> > program that is provided with the library isn't reporting any problems.
> > I tried adding a call to SHPComputeExtents() but that didn't work
> > either.  Any thoughts are this point would eb helpful.  Thanks!
> > 
> > Here is glimpse of the code:
> > 
> >     SHPGetInfo(shpHandle, NULL, &shapeType, NULL, NULL);
> > 
> >     // Allocate memory for the points
> >     padfX = static_cast<double *>(malloc(sizeof(double) * (geo.size() +
> > 1)));
> >     padfY = static_cast<double *>(malloc(sizeof(double) * (geo.size() +
> > 1)));
> > 
> >     // We never do multiple parts
> >     panParts[0] = 1;
>

> Brian,
> 
> >From the SHPCreateObject() docs:
> 
>   panPartStart:		The list of zero based start vertices for the rings
>                         (parts) in this object.  The first should always be
>                         zero.  This may be NULL if nParts is 0.
>   
> 
> So, I think panParts[0] should be set to 0. 

That was exactly the problem.  Thank you for you help.

Brian

(Does this mean the shpDump program should be modified to check for the panParts?  Just a thought)



More information about the Shapelib mailing list