AARoads Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

New rules for political content in signatures and user profiles. See this thread for details.

Author Topic: Mississippi county collecting  (Read 2089 times)

hbelkins

  • *
  • *
  • Offline Offline

  • Posts: 12933
  • A sense of humor is a wonderful thing. Get one.

  • Age: 57
  • Location: Kentucky
  • Last Login: March 21, 2019, 02:05:59 PM
    • Millennium Highway
Mississippi county collecting
« on: February 02, 2017, 04:30:30 PM »

Here's your assignment, should you choose to accept it.

Plot the shortest, best and most direct route to pick up all the counties in white that lie north of I-20, beginning in the north and ending in Jackson.



(Crossposted to the Road Trips board...)
Logged

Jim

  • *
  • Offline Offline

  • Posts: 3689
  • Check out http://travelmapping.net

  • Location: Amsterdam, NY
  • Last Login: Today at 10:13:34 AM
    • Travel and Other Pictures
Re: Mississippi county collecting
« Reply #1 on: February 02, 2017, 04:54:58 PM »

Sounds like a great motivation to combine Travel Mapping data with county information (is there an free/easy/automated way to query the county for a given lat,lng point?).  If I could do that, this could be a fun task for me or my Algorithms students...
Logged
Photos I post are my own unless otherwise noted.
Signs: http://www.teresco.org/pics/signs/
Travel Mapping: http://travelmapping.net/user/?u=terescoj
Counties: http://www.mob-rule.com/user/terescoj
Twitter @JimTeresco (roads, travel, weather, sports)

yakra

  • *
  • Offline Offline

  • Posts: 1042
  • Location: Area Code 207
  • Last Login: March 12, 2019, 11:48:14 AM
Re: Mississippi county collecting
« Reply #2 on: February 06, 2017, 11:36:40 AM »

Sounds like a great motivation to combine Travel Mapping data with county information (is there an free/easy/automated way to query the county for a given lat,lng point?).  If I could do that, this could be a fun task for me or my Algorithms students...

Mississippi GIS Data Download / County Boundaries

You can use QGIS to re-save the GIS data layer in your choice of coordinate reference systems. I just re-saved the county boundaries layer in NAD83(CSRS98), which I believe is the same CRS that the Canadian GeoBase files use.
I haven't checked (IE, loaded the SHP file into a hex editor) to be sure, but odds are good that the resulting file will have its data saved in 64-bit floating point, lng/lat format. Which of course should Play Nice with TravelMapping data.
From there, writing a quick-n-dirty program to dump the polygons to individual files (in whatever format you need -- even, say, WPT) should be relatively easy.

So yeah. That's your county data in lat,lng format at least. As far as a way to query the county for a given point, I'll leave that as an exercise for you and/or your students. :)
Logged
"Officer, I'm always careful to drive the speed limit no matter where I am and that's what I was doin'." Said "No, you weren't," she said, "Yes, I was." He said, "Madam, I just clocked you at 22 MPH," and she said "That's the speed limit," he said "No ma'am, that's the route numbah!"  - Gary Crocker

yakra

  • *
  • Offline Offline

  • Posts: 1042
  • Location: Area Code 207
  • Last Login: March 12, 2019, 11:48:14 AM
Re: Mississippi county collecting
« Reply #3 on: November 19, 2017, 02:43:23 AM »

I now have WPT files for each of 82 counties. 8-)

Quote from: SHP file format spec
A polygon consists of a number of rings.  A ring is a closed,
non-self-intersecting loop.  The order of vertices or orientation for a ring
indicates which side of the ring is within the polygon.  The neighborhood to
the right of an observer walking along the ring in vertex order is the
neighborhood inside the polygon.  Vertices for a single, ringed polygon are,
therefore, always in clockwise order.

As far as querying a county goes, how about this...?
Search for the nearest vertex or edge to the lat,lng point. (The QuadTree can help with this, yes?)
Each edge can store 1 or two associated polygons, just as a TMG file stores an edge's associated routes. (In an HDX style view, county lines would be green, and the state line blue.)
The vertex order would determine whether the lat,lng point is in the polygon on one side, the polygon on the other, or not within any polygons / outside Mississippi.
« Last Edit: November 19, 2017, 03:23:18 AM by yakra »
Logged
"Officer, I'm always careful to drive the speed limit no matter where I am and that's what I was doin'." Said "No, you weren't," she said, "Yes, I was." He said, "Madam, I just clocked you at 22 MPH," and she said "That's the speed limit," he said "No ma'am, that's the route numbah!"  - Gary Crocker

Jim

  • *
  • Offline Offline

  • Posts: 3689
  • Check out http://travelmapping.net

  • Location: Amsterdam, NY
  • Last Login: Today at 10:13:34 AM
    • Travel and Other Pictures
Re: Mississippi county collecting
« Reply #4 on: November 19, 2017, 07:22:50 AM »

I am teaching Algorithms in the spring, so this could happen...
Logged
Photos I post are my own unless otherwise noted.
Signs: http://www.teresco.org/pics/signs/
Travel Mapping: http://travelmapping.net/user/?u=terescoj
Counties: http://www.mob-rule.com/user/terescoj
Twitter @JimTeresco (roads, travel, weather, sports)

yakra

  • *
  • Offline Offline

  • Posts: 1042
  • Location: Area Code 207
  • Last Login: March 12, 2019, 11:48:14 AM
Re: Mississippi county collecting
« Reply #5 on: November 20, 2017, 11:52:18 AM »

I can upload the WPTs to GitHub or email them if you'd like. They're 908k zipped up.

:coffee: Scattered thoughts:
We'd need to pay more attention to edges than vertices, which gets... more involved. I won't get further into that, because brevity. :)
Not aware of any such instances in MS, but there's the case of holes in polygons, E.G. a county entirely surrounding another county or group of counties. WPT, only intended to represent polylines, won't support this, but SHP does. A more detailed...
Quote from: a more recent revision of the shapefile spec
A polygon consists of one or more rings.  A ring is a connected sequence of four or more
points that form a closed, non-self-intersecting loop.  A polygon may contain multiple
outer rings.  The order of vertices or orientation for a ring indicates which side of the ring
is the interior of the polygon.  The neighborhood to the right of an observer walking along
the ring in vertex order is the neighborhood inside the polygon.  Vertices of rings defining
holes in polygons are in a counterclockwise direction.  Vertices for a single, ringed
polygon are, therefore, always in clockwise order.  The rings of a polygon are referred to
as its parts.
A possible workaround: check whether all a county's polylines are themselves within another given polygon.
If doing this in, say, Virginia, allowing holes in polygons would be more necessary: Independent cities.

Do I see another HDX file type on the horizon, for multi-part polygons? 8-)
Logged
"Officer, I'm always careful to drive the speed limit no matter where I am and that's what I was doin'." Said "No, you weren't," she said, "Yes, I was." He said, "Madam, I just clocked you at 22 MPH," and she said "That's the speed limit," he said "No ma'am, that's the route numbah!"  - Gary Crocker

yakra

  • *
  • Offline Offline

  • Posts: 1042
  • Location: Area Code 207
  • Last Login: March 12, 2019, 11:48:14 AM
Re: Mississippi county collecting
« Reply #6 on: November 20, 2017, 12:02:54 PM »

Jim, I've copied our discussion to the TM forum, so as not to spam up HB's post here on AARoads with a bunch of not-too-relevant stuff.
Logged
"Officer, I'm always careful to drive the speed limit no matter where I am and that's what I was doin'." Said "No, you weren't," she said, "Yes, I was." He said, "Madam, I just clocked you at 22 MPH," and she said "That's the speed limit," he said "No ma'am, that's the route numbah!"  - Gary Crocker

codyg1985

  • *
  • Offline Offline

  • Posts: 2053
  • Age: 33
  • Location: Huntsville, AL
  • Last Login: March 23, 2019, 05:51:41 PM
Re: Mississippi county collecting
« Reply #7 on: November 21, 2017, 09:58:23 AM »

Calhoun County, MS is the hardest of all of those to get. How long of a period would you be around trying to get those counties?
Logged
Cody Goodman
Huntsville, AL, United States

hbelkins

  • *
  • *
  • Offline Offline

  • Posts: 12933
  • A sense of humor is a wonderful thing. Get one.

  • Age: 57
  • Location: Kentucky
  • Last Login: March 21, 2019, 02:05:59 PM
    • Millennium Highway
Re: Mississippi county collecting
« Reply #8 on: November 21, 2017, 10:07:46 AM »

Not that this has much relevance to me anymore. I was planning to attend last spring's meet in Jackson, Miss., but my health problems a few weeks prior not only sapped my stamina and energy to make such a long trip, but all my leave days from work that would have allowed me to travel. At this point I'm not sure when I will be able to travel to Mississippi.
Logged

Avalanchez71

  • *
  • Offline Offline

  • Posts: 1022
  • Location: Middle Tennessee
  • Last Login: Today at 12:16:05 PM
Re: Mississippi county collecting
« Reply #9 on: December 12, 2017, 12:41:48 PM »

Stay out Itawaba County.  The SO is full of tyrants.

Logged

 


Opinions expressed here on belong solely to the poster and do not represent or reflect the opinions or beliefs of AARoads, its creators and/or associates.