Post Reply 
HP 48GX - Store Coordinates in a List
03-31-2021, 09:27 PM
Post: #5
RE: HP 48GX - Store Coordinates in a List
(03-28-2021 04:21 AM)MNH Wrote:  Suppose I have coordinates representing the topographic features of a piece of commercial property. There will be coordinates representing the property boundary too. These coordinates will be stored by point number, but not in consecutive order, and not starting with point number one. If I want to store the coordinates in a list of lists, these constraints might be a pain to deal with. Each list in the list will have the following format:
Point #, A 2-D vector (Northing (Y-value), Easting (X-value)), Description of the point

Some examples would be:
{100 [5000 5000] "PROP COR"}
{500 [5200 5100] "BLDG COR"}
Stored in a list would be {{100 [5000 5000] "PROP COR"},{500 [5200 5100] "BLDG COR"}}
Assume user is programming in User-RPL.

There's a gap from 1 to 99 and 101 to 499. That's a lot of wasted memory; there are 500 positions available in the list, but only 2 positions are being used. What's the solution? Without knowing the starting position of the first list or the ending position of the last list, the solution isn't easy. Also, when getting a list from the list, point # 100 is in the first position; there's an offset of N+99, if I'm not mistaken.

You are mistaken. ;-) There's no offset and no wasted space - your list is storing exactly what you see, namely the number 100, followed by an array [5000,5000] followed by a string and so on. That number 100 is just a number in a list and has no special meaning.

Quote:Maybe I could do something like this after point # 100 is stored:
{100 100 {100 [5000 5000] "PROP COR"}}, where 100 is the starting index and 100 is the ending index.

Lists don't have indexes like that. There's no handy "store this under index 50; retrieve index 50" pair of commands, unfortunately.

Quote:After point # 500 is stored:
{100 500 {100 [5000 5000] "PROP COR"},{500 [5200 5100] "BLDG COR"}}

A typical point numbering scenario for a survey crew might be:
1 to 99 - control points
100 to 199 - property corners
200 to 499 - underground utilities
500 and above - topographic features

I was thinking points might be stored in banks of 50 points each to conserve memory.
{1 1 50 {100 [5000 5000] "PROP COR"} ... { }}, where 1 is the number of available banks
{2 500 550 [5200 5100] "BLDG COR"} ... { }}, there are now 2 available banks

No need, one list is just as good as two in this scenario. If you do want to split up the lists to separate the points logged by different crews then I would suggest using different variable names for each of the lists rather than adding another number to the beginning.

Quote:Does anyone have any suggestions about how this might be done?
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: HP 48GX - Store Coordinates in a List - BruceH - 03-31-2021 09:27 PM

User(s) browsing this thread: 1 Guest(s)