[mapserver-users] distance search in PLSS

Ed McNierney ed at topozone.com
Wed Aug 28 12:44:54 EDT 2002


Puneet -

For the quarter-mile radius case, I would simply generate a 8 x 4 x 36 = 1152-element table.  Each quarter-section has eight neighbors within a quarter-mile, in the compass directions N, NE, E, SE, S, SW, W, and NW.  Each row of the table is:

DIR, SN, QSN, DT, DR

where

DIR - Compass direction (N, NE, etc.)
SN - Section Number
SQN - Quarter Section ID
DT - Delta Township (see below)
DR - Delta Range (see below)

For township and range you need to deal with whether your range is E or W and the township is N or S.  The Delta values are always either 1, 0, or -1 indicating whether the neighbor is in the current township and range, or the "next" one.  The exact meaning of "next" depends on whether the source is E or W, N or S.

For example, say you're starting with SE 1/4, S24, T30N, R12E.  The eight table entries for this quarter-section are:

N, 24, NE, 0, 0
NE, 19, NW, 0, +1
E, 19, SW, 0, +1
SE, 30, NW, 0, +1
S, 25, NE, 0, 0
SW, 25, NW, 0, 0
W, 24, SW, 0, 0
NW, 24, NW, 0, 0

Even this is overkill, because the QS label can be calculated easily (i.e. if you go SE from a SW quarter-section, you always get to a NW quarter-section).

You organize the table so each block of 8 is the four quarter-sections of a given section, and the sections are grouped in numerical order, so there are 4 x 8 = 32 lines for each section.  If you ran them NW, NE, SW, SE, for example, you would find these eight lines for SE 1/4, S24 at the 24th block of 32 lines into the file, and the SE QS would be the last eight of these 32 lines.

Let's take the first line.  It means that when you go North from this QS, you get to NE 1/4 of S24, T30N, R12E (because the Township and Range deltas are both 0, they're both identical to the source).

The next line says that the NE neighbor is the NW 1/4 of S19, T30N, and Range +1.  If the Range is E, then +1 means add one, so it's R13E.  If Range is West, you need to reverse the sign (that is, the Range east of R12E is R13E, but the range east of R12W is R11W).  The same is true for Township deltas, although they're all 0 here.

If you apply a Township or Range delta and get 0, then make it 1 and switch the E/W or N/S sense - it means you crossed the baseline or meridian.

Completion of the table is left to the reader, or I can send you our billing rates <g>.

	- Ed

-----Original Message-----
From: Puneet Kishor [mailto:pkishor at geoanalytics.com]
Sent: Wednesday, August 28, 2002 12:08 PM
To: Ed McNierney; mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] distance search in PLSS


Ed,

Here are some more assumptions...

> From: Ed McNierney [mailto:ed at topozone.com]
..
> How accurate do you need to be? 

not at all really... as long as I get a list of the contiguous trsq in all
directions... as I said, the selection would be "pass-through" (it could be
"contains" as well, but for now let's assume "pass-through"... even if it is
"contains" it doesn't have to be precise, for ex, if doing radius searches,
square qs won't fit completely inside a circle, etc.)


> The two issues I can think 
> of right off are that you don't know when the current 
> meridian runs out and you need to look at a new one, 

yes, that is a problem, but again, let's assume that my area of interest
lies completely within one...

> and the 
> fact that the grids aren't entirely regular and have many 
> hole in them, especially around Indian reservations and other 
> unsurveyed areas.  That is, if you start with T21, R10, S23, 
> the next section to its west will be  Section 22 - IF Section 
> 22 actually exists at all.

again, let's assume that I have a completely contiguous grid for my area of
interest.

fwiw, my area of interest is the Northern Illinois region, but that is
neither here nor there.

tia,

pk/




> 
> -----Original Message-----
> From: Puneet Kishor [mailto:pkishor at GeoAnalytics.com]
> Sent: Wednesday, August 28, 2002 11:23 AM
> To: mapserver-users at lists.gis.umn.edu
> Subject: [mapserver-users] distance search in PLSS
> 
> 
> not directly a mapserver question, but...
> 
> given a PLSS quarter-section, and a distance (let's assume, 
> in increments of
> 1/4 mile, since each qs is a quarter-mile square), I want to 
> return a list
> of all the quarter-sections and their parent sections, townships, and
> ranges. 
> 
> For example, if I choose T21, R10, S23, NW, what trsq values 
> would be around
> it within a radius of 1/2 mile.
> 
> Also, let's assume that I am interested in pass-through 
> selections. So,
> every 1/4 mi incremented radius will select the "next" outer 
> set of trsq.
> 
> The catch is, I don't want to do this spatially... instead, I 
> want to use a
> database... in other words, pure logic and math.
> 
> I have a table of PLSS values with fields for t, r, s, qs. 
> PLSS follows a
> set pattern. It is reasonable to assume that an algorithm 
> could be devised
> to do this on the fly.
> 
> Any ideas, anyone?
> 
> tia,
> 
> pk/
> 



More information about the mapserver-users mailing list