v.in.shape error

Eric G . Miller egm2 at jps.net
Thu Sep 7 00:28:11 EDT 2000


On Wed, Sep 06, 2000 at 11:11:11PM +0000, Joseph Brian Adams, PhD wrote:
> Using 5.0beta8, I am trying to import a shape file with about 300
> areas.  I got the following error.
> 
> v.in.shape: shp2dig.c:751: partCalcFieldsPolygon: Assertion
> `fabs(newx1) < 1.0e10 && fabs(newx2) < 1.0e10' failed.
> 
> I have used v.in.shape on several other smaller shape files, and it
> has worked.  I was wondering if this is most likely a problem with my
> data.

Looks like a sliver polygon or two vertices essentially on top of each
other.  There are some tools out there for checking and "cleaning"
shapefiles.  You might check ESRI's website.  There are all kinds of
contributed and free extensions.  I remember tracking down a shapeclean
extension a while back, but I don't have the info right now.

 
> Also, v.in.shape only imports into Lat-Long.  To convert to UTM, I
> have been converting the vector file to ascii, running m.ll2u, then
> converting back to a vector file.  The problem is that I loose my
> attribute data when I do this.  Is there an easier way?

This is incorrect.  ArcView actually knows a bit about projections.
Unfortunately, the shapefile format spec. stupidly left out any way to
keep track of that information.  Rumor is, this will be corrected in
future versions -- presumably with a *.prj file.  Moral is, stop
projecting your data back and forth, it's unnecessary.  Also, there's a
projection extension available (Projector) for ArcView which will
project from decimal degrees to whatever.  No inverse projection is
available, and the aforementioned problem remains (I suggest keeping a
text file with all of your shapefiles to hold such metadata).  The
Shapelib suite of utils also has a projection utility in contrib (needs
proj4 to compile). (I think ArcView has an algorithm that basically
says, if coordinates not in the domain of lat/lon, assume projected).

I could probably work up a list of URL's for ArcView extension
tomorrow...  The California Department of Fish and Game has a guy who
spends most of his time just writing these things.  Several of them are
quite useful.

-- 
/bin/sh ~/.signature:
Command not found




More information about the grass-user mailing list