Valued Contributor
Posts: 60
Registered: ‎08-07-2009
Message 1 of 7 (461 Views)

# Challenge to any Lisp guru to help me beat my ESRI Co-worker

461 Views, 6 Replies
02-29-2012 02:33 PM

I've got to prove to our ESRI guy that I can do everything in CAD that he does in ARC.

We use a "Sliding Mile" to determine the pipeline "Class" which means we count how many buildings there are within a defined corridor along the centerline within 5280’ (measured along the pipeline centerline) of whatever starting point is used. The # of structures in that boundary determines if that section of pipe has class 1, 2, 3 or 4. Starting at either end we move along the pipeline centerline PUSHING the Sliding Mile along the pipeline centerline, When the rear edge of the sliding mile contacts the first building (building #1). The buildings will usually be defined by a rectangle. Then we count all the structures ahead that fall in the sliding mile boundary to determine class. If there are enough buildings to warrant class we will place a circle of the appropriate radius at the corners of the building #1 and last building (Building #15) encountered in the sliding mile. The furthest points, measured along the pipeline centerline, where those circles intersect the pipeline centerline will determine the limits of the class for that section of pipeline. Then we push the sliding mile to the next building (building #2) and repeat the process. If no other buildings are identified in the new location of the sliding mile then the original class limits, as measured from building #15 stands and we begin a section of pipe with no class.

We repeat this process until we reach the end of the pipeline. This is a simple example; typically it gets a lot more complicated. All the buildings are sorted into a few categories by their layer, for example: any building 4-stories or more is automatically class-4 regardless of the count, they get their own layer. So every combination of building category is analyzed along with distance from the pipe and by the number of the buildings within the sliding mile.

In my mind the simplest automation tool would be two lines representing the limits of the sliding mile. These two lines should stay perpendicular to the pipe and stay 5280’ apart, as measured along the pipeline centerline. The user should be able move them to any point along the pipeline centerline. These perpendicular lines must extend to the outer limits of the corridor on both sides of the pipe, so may they should be user defined. I guess we manually draw construction lines from the buildings perpendicular to the pipeline centerline and the lisp just uses some form of dot or tick mark to represent the limits of the sliding mile, but that doesn’t really help much.

The ultimate would be for the lisp to open a dialog box where you enter all the criteria for class 1, 2, 3 and 4 (a one-time setting kind of thing) then to simply select the polyline that represents the pipeline centerline and have the lisp count the buildings, determine the class, break the centerline at the class limits, and change the segments of pipe to the layer of the appropriate class (width, linetype, color, etc.) Maybe in the setup dialog box you select whether you want the centerline broken or if you want to retain the centerline and simply trace over the class segments on the appropriate layer.

Any of you Mad Lispers out there want to give this a try???

Distinguished Mentor
Posts: 525
Registered: ‎03-02-2011
Message 2 of 7 (437 Views)

# Re: Challenge to any Lisp guru to help me beat my ESRI Co-worker

03-01-2012 12:36 PM in reply to: K1200RS

Have you looked at Map's workflow tools for automation - seems like it would be a worthwhile effort, but I lack enough time to try it right now

C3D 2011
Intel Xeon E5630@2.53Ghz
12GB Ram / Win7 Professional 64bit SP1
Valued Contributor
Posts: 60
Registered: ‎08-07-2009
Message 3 of 7 (431 Views)

# Re: Challenge to any Lisp guru to help me beat my ESRI Co-worker

03-01-2012 01:41 PM in reply to: K1200RS

I know they exist, but have not tried to work with them. I will give it a shot. Thanks for the idea.

Valued Mentor
Posts: 374
Registered: ‎03-24-2004
Message 4 of 7 (412 Views)

# Re: Challenge to any Lisp guru to help me beat my ESRI Co-worker

03-02-2012 03:23 AM in reply to: K1200RS

to locate a station for each house, moving from top to bottom of your line,the

station location is found by the intersection of lines perpendicular to the

centerline extending to the corridor boundaries l & r where the perpendicular line

first contacts a building?

Thus the end of the perpendicular line at the intersection with the centerline yields

the start of the sliding mile point x,y on the centerline for house 1 and the other

end of the mile is that x,y plus 5280 feet of line length to x2,y2 where

perpendicular lines extends to the corridor limits?

first test zone would be from St house 1 to st house 1 + 5280,
2nd test zone would be st house 2 to st house 2 + 5280, etc until you run out of

line?

how do want to handle a building such as the one you have the comment beside?  the

first perpendular line is where your red line is and you get a postive test of

intersection around the corner again as the perpendicular line hits the same corner

of the building and goes basically straight down.  Do you count the building again?

Instead of all that would it be reasonable to divide the centerline into one foot or

ten foot sections and test at each interval?

Do your buildings have any data, ie sq footage, # units, # stories that play into the

calculations?

Your map is PA83-NF but measurements come back in yards?  correct?  i.e., the center

line in the blue buffer is 1760 units long using _mapcgcdist to measure it; or is it

only 1/3 mile?

any part of a building footprint inside the blue buffer adds to the count? what is

the unit of count? 1 per building or weighted by factor such as usage or # stories or

units? i.e does a tool shed = a four unit story appartment building?

What determines the radius of the circle?  You mentioned 15 houses in your op but

there are only 14 in the interval.  does that make a difference?

Valued Contributor
Posts: 60
Registered: ‎08-07-2009
Message 5 of 7 (402 Views)

# Re: Challenge to any Lisp guru to help me beat my ESRI Co-worker

03-02-2012 07:02 AM in reply to: K1200RS

I’m not concerned about stationing the houses in this exercise. At first read I thought you had misunderstood, but I see that you are thinking thru how to write the code. I think your logic is sound.

The building only gets counted once. In my shallow brain pan, going around the P.I.’s gets tricky for automation. With a simple lisp I see situations like this requiring a manual check, but maybe only count an object once is no biggie.

We round everything to the nearest foot so I’d say ½ foot sections, but I’d admit that when designing the pipe it makes more sense to change pipe grade and/or wall thickness at the end of the joint instead of cutting a section of pipe in half to start that heavy wall pipe at the exact station the class requires it. We do perform this analysis for proposed pipe, as I have described, but we also perform this every year on existing pipe. If someone builds a shopping center 500 feet away we may have to replace pipe in that area if more frequent testing or running lower pressure doesn’t meet the regulations. Taking all of that into consideration I still look at this sliding mile as beginning at the exact point on the centerline that is perpendicular to the leading edge/corner of the first building be it station 123+45 or 123+45.6.

The buildings belong to these Categories and are draw on layers of the same name:

UNKNOWN

BIFO (Buildings Intended For Human Occupantcy with 19 or less people)

BIFO20 (20 or more people)

BIFODIS (19 or less with disability)

BIFO20DIS (20 or more with Disability)

BIFO4 (4 Stories or more)

WDA (Well Defined Areas like parks, recreational area, outdoor theater, etc.)

Every apartment/condo in the unit gets counted, generally as a BIFO

I’m not sure how the drawing got to meters; it’s feet on my end, but after all CAD doesn’t care, it’s just a unit. The buffer should be 660 feet.

Correct, any portion of the building crossing into the buffer gets counted initially, if the inclusion of that building makes a difference in class it will be investigated further. So for this exercise we count it.

10 BIFO’s or less in the sliding mile is Class-1, but we design past Class one requirements and do not call out Class-1, it is just understood. 11-45 BIFO’s in the sliding mile is Class-2, 46 or more is Class-3. Any building 4 Stories or more constitutes Class-4. Also when a BIFO20 or WDA is within 300 feet of the pipe it is Class-3.

I am still learning this, so there may be different circle radii, but what I am using now is 600 feet.

I just pulled the #15 out of the sky and it had no bearing on anything in the drawing.

I hope this helps. Thank you.

Valued Mentor
Posts: 374
Registered: ‎03-24-2004
Message 6 of 7 (399 Views)

# Re: Challenge to any Lisp guru to help me beat my ESRI Co-worker

03-02-2012 07:16 AM in reply to: K1200RS

Ok

So why lisp code?

I see building with BIFO's units density.  a GIS anaysis should be able to show what clusters of buildings have the sum total of BIFO's that require a class of pipe based on the location of the buildings within a proximity range of a given distance from each other and the pipe and within the "sliding mile buffer" which I think becomes irrelavant to some extent as a class 4 pipe is placed in minimum section lengths such a  mile or 1000 or 40 feet when the building density/usage calls for it.

Your units ratio is 3 as in a factor of three feet to a yard, not 3.281. it is not metric by my measurements.

I rest while some others hash this over

Dave

Valued Contributor
Posts: 60
Registered: ‎08-07-2009
Message 7 of 7 (394 Views)

# Re: Challenge to any Lisp guru to help me beat my ESRI Co-worker

03-02-2012 08:49 AM in reply to: K1200RS

Lisp, because I have very little knowledge of the GIS analysis tools and assumed that this would not be possible with any existing tools. I'll do some research on the existing tools.

Recently Solved