Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am reading a shapefile for a pipeline and what I've noticed is that if I just draw a line from one point to the next (in the order I read them), there will be points where the line terminates, and the next point is really a new line - but I can't see any way to tell where those points are... How does that work?

share|improve this question
4  
Can you expand upon your question to include code samples, screenshots, sample data, etc? Also please try to describe the problem you are having more clearly, it's a bit difficult to follow. –  blah238 Oct 28 '12 at 23:32
    
is there a field in the shapefile that has a pipeline segment number? –  mhoran_psprep Oct 29 '12 at 12:46
    
Not to sure how to accomplish this, but due to your question I discovered pyshp which is awesome! –  Cody Brown Oct 29 '12 at 19:16

1 Answer 1

A bit late but what the heck :P

If a row contains multiple new/disconnected lines as you suggested you can find the index positions where "the next point is really a new line" by calling the shape.parts attribute. Note that if there is only one line then the indexlist from shape.parts will still list the first point, ie [0].

Check out the Pyshp docs for more on how to use it: http://code.google.com/p/pyshp/wiki/PyShpDocs

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.