georeference.org
Subscribe to this thread
Home - Scripting / All posts - Creating point objects from a line attribute
anajera47 post(s)
#26-Aug-08 14:32

Hello all

This thread was originally posted at the General section trying to find a solution using the set of tools available in Manifold but so far, tnothing has been found yet. So I guess programming/scripting shall be involved to process the information and attempt to get the desired results. As the approach looked for in the beggining was with the traditional Manifold tools and now we look for a programming one, I hope this is not considered doule posting.

The file ExternalNumbers.map has been uploaded for reference.

I have a drawing with lines representing blocks in a city. One of the attributes on the drawing table are the house numbers. There is a column named NumExt which has all the external numbers belonging to that part of the block, separated by commas as follows:

3,5,7,9,11,13,15,17,19,21,23,25,29,31,33,3,5.7,9,17

Different blocks have different sets of numbers as can be seen in the attached file.

I need to create a point feature for each of the house numbers contained in this column and prefereabily (though not a most) evenly aligned along the line representing the block where the numbers belong to. So there shall be one point feature for house number 3, another for house number 5 and so forth.

So the first step should be to split the numbers within the NumsExt column into separate individual objects. Then it will be possible to deal with each independently.

The conceptual idea would be to:

1. Create one line object with each of the house numbers opverlapping the original line

2. Obtain the centroid for each ovelapping line. This would create one point object with each of the house numbers for a given line segment.

3. Align the centroids evenly along the original line extent (Optional, not a must)

In order to perform step 1, a script should be developed to read the NumsExt column for a given field. It would identify each house number by using the commas as a separator. Once a full number is detected, a new line object would be created assigning the identified number to its NumsExt column and overlapping the original line. Do the same for the second number in the original NumsExt data for that field and create a line object for it. Continue until the last number in the NumsExt for that field is processed. Then move on to the next field and repeat the same process.

Once all the fields have been processed, the centroids can be obtained. This could be done with either the standard centroids tool within Manifold or could be part of the script as well.

Then, another script shall be developed to align the centroids along the original line.

I am familiar with VB so that is what I would like to use, though I have never done programming in Manifold, so any help on how to achieve this will be greatly appreciated.

Does anyone have an idea on how this could be done other than manually?

Thanks in advance for any ideas

Alberto

Attachments:
ExternalNumbers.map

0 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.