Jump to content

 
Photo

Selecting street segments by nodes (or line segments)

- - - - -

  • Please log in to reply
11 replies to this topic

#1
Josh

Josh

    Contributor

  • Validated Member
  • PipPip
  • 25 posts
  • Gender:Male
  • Location:San Francisco
  • Interests:wild mushrooms, kites & kite boarding, climbing, bouldering, graphic design, dive bars, dive restaurants, diving, museums, movies from the 70z, downloading music that i'll never listen to, politics, bitching about politics, comics (yes...i still read comics but i don't have a star trek outfit), project management, cute girls walking down the street, a perfect latte, good wine (bad wine too), and all that keeps me entertained during the day.
  • United States

I would think this would be simple, but I'm having a little trouble figuring out how to select segments based on how many nodes they have.
I work in both MAPINFO and ARCVIEW, so i am not very particular as to which platform i use. I'm leaning towards MapInfo since when i double click on a street, it shows me the number of line segments. This makes me think i could query out all the segments that just have 2 nodes.

There are some 14,000 street segments in this layer, so doing it manually isn't really an option.

If anyone has an idea of how to do this, I would forever be in your debt!:)
Cheers,
Josh

#2
chauncey

chauncey

    Newbie

  • Validated Member
  • Pip
  • 6 posts
  • Location:94117
  • Interests:How to make attractive pictures representing where stuff is and the patterns it makes with where other stuff is, was, will be or could be.
  • United States

I would start out in ArcMap, get free version of ETGeoWizard, see ian-ko.com (Mr. IANKO Tchoukanski rocks!!!!, thanks!!)
check out the
Export Nodes Wizard on the Polyline tab which does the following:

Analyzes the nodes of a polyline layer and exports them as a point feature class.

Inputs:

A polyline feature layer
Types of nodes to be exported
Outputs:

New point feature class
Contains points representing the specified node types
Regular nodes - node where more than two polylines intersect
Pseudo nodes - occur where a single line connects with itself or where only two polylines intersect
Dangling nodes - unconnected nodes of a dangling polylines
Several fields are added to the point attribute table :
[ET_Type] - thetype of node.
[PL_FID1], [PL_FID2] ...[PL_FIDn] carrying the IDs of the polylines that intersect in the node

the part that doesnt jump out at me is how to somehow make a column on your line table that has calculated the number of nodes; join your new point file...urrrr...play with it

of course with 14K nodes I think you might have to buy the GeoWizard--

If by ARCVIEW you mean 3.2a, the one for arcView 3.2a is free it has this function: thanks IanKo: http://www.ian-ko.co..._user_guide.htm
Polyline To Point - Converts polyline theme to point theme. All the vertices of the polylines are converted to points. An unique ID is assigned to the points that allows for easy conversion back to polylines. Each point is assigned a position along the pertaining line. Note: If you want the angle of the polyline in each vertex to be added to the point attribute table use the Polyline To Point function on the ET Polyline dialog with Vertex option


good luck,
chauncey

#3
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,834 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

This is really a scenario where FME would shine. Use a CoordinateCounter to count the number of coordinates per line and store that in a temporary attribute. Then use a Tester to make the selection.

If you want, you can email me the file privately and I can run it trough FME for you...
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#4
ELeFevre

ELeFevre

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 1,049 posts
  • Gender:Male
  • Location:Louisville, Colorado USA
  • Interests:Cartography, musical instruments, reading, hiking, craft beer
  • United States

This is really a scenario where FME would shine. If you want, you can email me the file privately and I can run it trough FME for you...


Hans,
You should just add these two sentences to your signature :)



#5
Josh

Josh

    Contributor

  • Validated Member
  • PipPip
  • 25 posts
  • Gender:Male
  • Location:San Francisco
  • Interests:wild mushrooms, kites & kite boarding, climbing, bouldering, graphic design, dive bars, dive restaurants, diving, museums, movies from the 70z, downloading music that i'll never listen to, politics, bitching about politics, comics (yes...i still read comics but i don't have a star trek outfit), project management, cute girls walking down the street, a perfect latte, good wine (bad wine too), and all that keeps me entertained during the day.
  • United States

Hans,

What is FME? I may take you up on your offer, but that does seem like cheating:)
If i can figure it out using Chauncey's method that would be great. Otherwise, YES, I'll be sending you the streets of San Francisco!

Thanks again,
Josh

#6
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,834 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Josh,

FME is a spatial ETL (extract-transform-load) tool with a intuitive interface and support for lots of GIS formats. That's the official blurb (see http://www.safe.com for more details). I personally call it a hardcore, batchable GIS processing app with a flowcharty-based interface. It's great for automating repetitive tasks (and speeding them up in the meantime).

I wouldn't call it cheating, unless it will keep me occupied for hours, but I doubt it will, the problem is simple enough and the rest is just processing time... :rolleyes:

Erin,

Yes, I think I should... I will be doing a presentation on FME during PCD at the upcoming NACIS conference though :)
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#7
Charlie Frye

Charlie Frye

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 112 posts
  • Gender:Male
  • Location:Redlands, CA
  • Interests:Base map design/data model, political/election maps; use of historical maps for modern GIS analysis
  • United States

Here's a solution for ArcGIS:

This is a field calculator statement and uses the Advanced option; the variable that must be entered into the [fieldname] = text box is: ec. (I haven't gotten around to writing this as a Python tool yet, so this is all I have).

'Vertex Counter
'Calculates into an Integer or Double Field
Dim pGeomColl As IGeometryCollection
Dim pgTest As IGeometry
Dim pPColl As IPointCollection
Dim pRing As IRing
Dim pc As Integer
Dim ec As Integer
Dim i As Integer
Dim sd As Integer

Set pGeomColl = [Shape]
pc = pGeomColl.GeometryCount
ec = 0
For i = 0 To (pc - 1)
Set pgTest = pGeomColl.Geometry(i)
sd = pgTest.Dimension
If Not pgTest.IsEmpty Then
If sd = 4 Then
Set pRing = pgTest
Set pPColl = pRing
ec = pPColl.PointCount
End If
End If
Next i

Charlie Frye
Chief Cartographer
Software Products Department
ESRI, Redlands, California

#8
CHART

CHART

    Chart

  • Validated Member
  • PipPipPipPipPip
  • 358 posts
  • No Country Selected

Josh, (I picked up this post a bit late).

Using MapBasic would get you there. May I suggest you look up the following MapInfo forum and post your questions.

http://groups.google...group/mapinfo-l

There are some pretty good MapInfo users on that forum that would probably be willing to help.
Chart

#9
gregsd

gregsd

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 169 posts
  • Gender:Male
  • Location:Surrey, England.
  • Interests:Cycling, mostly off-road (MTB) riding.
  • United Kingdom

I work in both MAPINFO and ARCVIEW, so i am not very particular as to which platform i use. I'm leaning towards MapInfo since when i double click on a street, it shows me the number of line segments. This makes me think i could query out all the segments that just have 2 nodes.


Josh,

You can do this using an SQL select in MapInfo. Something like this should work -

Select * from tablename where objectinfo(obj, 20) = 2

objectInfo(obj, 20) returns the number of nodes in a polyline or region object.

I use MapInfo/MapBasic all the time at work so if you need more help with this then let me know.

Greg


Greg Driver

GIS Analyst
MapInfo User...!

#10
CHART

CHART

    Chart

  • Validated Member
  • PipPipPipPipPip
  • 358 posts
  • No Country Selected

Greg,

Nice to see some MapInfo users on this Forum. Your MapInfo-SQL string instruction seems a lot simpler then an ArcGIS solution. ;) and no real need for any MapBasic with the SQL statement you provided.


...thanks for sharing.
Chart

#11
gregsd

gregsd

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 169 posts
  • Gender:Male
  • Location:Surrey, England.
  • Interests:Cycling, mostly off-road (MTB) riding.
  • United Kingdom

Greg,

Nice to see some MapInfo users on this Forum. Your MapInfo-SQL string instruction seems a lot simpler then an ArcGIS solution. ;) and no real need for any MapBasic with the SQL statement you provided.


Greg, thanks for sharing.


LOL, yep we seem to be in the minority on this forum!

I made a small mistake with the SQL statement below. It should be:

Select * from tablename where int(objectinfo(obj, 20)) = 2

Greg.


Greg Driver

GIS Analyst
MapInfo User...!

#12
Josh

Josh

    Contributor

  • Validated Member
  • PipPip
  • 25 posts
  • Gender:Male
  • Location:San Francisco
  • Interests:wild mushrooms, kites & kite boarding, climbing, bouldering, graphic design, dive bars, dive restaurants, diving, museums, movies from the 70z, downloading music that i'll never listen to, politics, bitching about politics, comics (yes...i still read comics but i don't have a star trek outfit), project management, cute girls walking down the street, a perfect latte, good wine (bad wine too), and all that keeps me entertained during the day.
  • United States

Greg..THANKS! this was such a simple solution...i'm really surprised. Makes me love MapInfo even more.
Cheers,
Josh




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->