Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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 attribute. Note that if there is only one line then the indexlist from will still list the first point, ie [0].

Check out the Pyshp docs for more on how to use it:

share|improve this answer

Your Answer


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.