#1 Add support for multi-part lines

open
nobody
None
5
2008-01-24
2008-01-24
Tom Russo
No

pagc will abort indexing a shapefile that contains any line with more than one part.

For example, using the file http://www.cabq.gov/gisshapes/netcurr.zip (after conversion from New Mexico State Plane Coordinates to EPSG:4326 with ogr2ogr), pagc aborts indexing at about 90% with the error:

Too many parts in shape 39672

Aborting read of netcurr_ll.shp

ogrinfo -al shows:

OGRFeature(netcurr_ll):39672
FUNCTIONAL (Integer) = 0
LEFTLOW (Integer) = 0
LEFTHIGH (Integer) = 0
RIGHTLOW (Integer) = 0
RIGHTHIGH (Integer) = 0
STREETNAME (String) = VENTANA VERDE
STREETDESI (String) = DR
STREETQUAD (String) = NW
ALTERNATES (String) = (null)
ALTERNATED (String) = (null)
len (Real) = 325.89040188500
MULTILINESTRING ((-106.755981947993988 35.194700695929527,-106.755982697143281 35.194699158738139),(-106.755981947993988 35.194700695929527,-106.755998825165193 35.194600274908431),(-106.755981947993988 35.194700695929527,-106.755972307000974 35.194758068888525,-106.755971790413369 35.194761125431519,-106.755972534987791 35.194768746833873,-106.755973977902883 35.194781031612187,-106.755975694245123 35.19479332898586,-106.755977666910297 35.194805579495643,-106.755979890405285 35.194817796902349,-106.755982381664182 35.194830013190185,-106.755985134796376 35.194842178011626,-106.755988138645151 35.194854291413222,-106.755991404452601 35.194866367085901,-106.75599492655526 35.194878391315399,-106.755998699346449 35.194890359545845,-106.756002739731841 35.194902299182303,-106.756007030607165 35.194914150765491,-106.756011549658936 35.194925914388598,-106.756016330698415 35.194937644861774,-106.756021368033714 35.194949323891628,-106.75602665585933 35.194960914868084,-106.756032182961761 35.194972408679419,-106.756037893074236 35.194983727712774,-106.756041048720078 35.194989731709441,-106.756046962623657 35.195000628596354,-106.756207797029731 35.19529003590705,-106.75629105520261 35.195439851819565))

and the code in shapepos.c's "get_shape" function trips on it:

/* -------------------------------------------------------------
This will have to be changed if there turn out to be addressable
shapes that are compound
-------------------------------------------------------------- */
if ( return_shape -> nParts > 1 ) {
LOG_ERR( "Too many parts in shape %d\n" ,
shape_number ) ;
SHPDestroyObject( return_shape ) ;
return NULL ;
}

Discussion