Connection from point to point

35 views
Skip to first unread message

Arnd Kielhorn

unread,
Jul 17, 2012, 11:12:46 AM7/17/12
to openjum...@googlegroups.com
Hello,

I often get gps points from a area and I want to create a polygon from it. Until now I created the border by drawing a polygon by snapping to every point.
So I am now looking for a function to connect the points to create a polygon automatically.
Does anybody have an idea?

Kindly regards
Arnd

edgar....@web.de

unread,
Jul 17, 2012, 11:17:06 AM7/17/12
to openjum...@googlegroups.com
geometry converter.. select all points and right click/convert geometries/to polygon. assuming they are ordered correctly in the layer this should work.

..ede

Stefan Steiniger

unread,
Jul 17, 2012, 12:47:27 PM7/17/12
to openjum...@googlegroups.com
Hi Arnd,

are you looking for a convex hull algorithm? (or is it non-convex?)
Is the connection sequence stored as attribute?

cheers,
stefan

Am 17.07.12 11:17, schrieb edgar....@web.de:
> -- You received this message because you are subscribed to the Google
> Groups openjump-users group. To post to this group, send email to
> openjum...@googlegroups.com. To unsubscribe from this group, send
> email to openjump-user...@googlegroups.com. For more options,
> visit this group at https://groups.google.com/d/forum/openjump-users?hl=en

Arnd Kielhorn

unread,
Jul 18, 2012, 11:38:00 AM7/18/12
to openjum...@googlegroups.com
Hi Stefan,
Hi Ede,

converting the selected points into polygon doesn't work (all point were selected).

It should not be a convex hull because often the gps points going a little bit zigzag so a convex hull overdraws it. It should draw the line/polygon from point to point.
Sometime there is the timestamp as an attribute but in many cases I only get gps points without attribut so I have no attribut which I could use.

Arnd

edgar....@web.de

unread,
Jul 18, 2012, 11:39:51 AM7/18/12
to openjum...@googlegroups.com
On 18.07.2012 17:38, Arnd Kielhorn wrote:
> converting the selected points into polygon doesn't work (all point were selected).

could you be a tat more specific?

do you have a sample dataset? ..ede

Stefan Steiniger

unread,
Jul 18, 2012, 12:35:18 PM7/18/12
to openjum...@googlegroups.com
Hei Arnd,

yep do you have an example of points and of how they should be connected?

However, if you have no time stamp or attribute etc,... how do you know
which way to connect (manually)?

cheers,
stefan

Am 18.07.12 11:39, schrieb edgar....@web.de:

edgar....@web.de

unread,
Jul 19, 2012, 4:39:45 AM7/19/12
to openjum...@googlegroups.com
Btw. Geomconv works on a per feature basis. You will have to merge the single geometries into one feature beforehand.

..ede



edgar....@web.de schrieb:

Arnd Kielhorn

unread,
Jul 19, 2012, 11:52:37 AM7/19/12
to openjum...@googlegroups.com
Hello Stefan,

attached You will find a sample file (PIROL-CSV). What I need is something like a detailed hull (border) as a point-to-point-polygon.

Arnd


> Betreff: Re: [openjump-users] Connection from point to point

> Hei Arnd,
>
> yep do you have an example of points and of how they should be connected?
>
> However, if you have no time stamp or attribute etc,... how do you know
> which way to connect (manually)?
>
> cheers,
> stefan
>
> Am 18.07.12 11:39, schrieb edgar....@web.de:
GGAtext3.txt

edgar....@web.de

unread,
Jul 19, 2012, 3:59:20 PM7/19/12
to openjum...@googlegroups.com
arnd, can you tell me how to open that file? ..ede

Stefan Steiniger

unread,
Jul 19, 2012, 4:34:58 PM7/19/12
to openjum...@googlegroups.com
you need the pirol CSV plugin in OpenJUMP, this would be able to open it.

http://www.al.hs-osnabrueck.de/fileadmin/users/159/upload/PlugIns/PirolCsv.jar

from here:
http://www.al.hs-osnabrueck.de/jump-download.html

though, could be that the baseclasses plugin is necessary too.

stefan

Am 19.07.12 15:59, schrieb edgar....@web.de:

edgar....@web.de

unread,
Jul 20, 2012, 6:39:32 AM7/20/12
to openjum...@googlegroups.com
if i merge the points to one feature 'gew. obj vereinigen' the order seems to get lost. at least with the big dataset.
this is illustrated by the fact that the multipoint geometry resulting when converted to a linestring looks like in the attached screenshot.

a smaller data set seems to work, which lets me assume that the points have the correct order in the csv file and something fishy goes on during merging.

to find out if it'd work in general i took some data from the beginning and end of the dataset to have a smaller test set (attached). then i did
- load it with pirol csv
- set layer editable
- merge the objects
- *try to convert to polygon (complains about closing segment)
- *convert to linestring to see where the segment is missing
- *close open linearring
- *convert to polygon

* with geomconv

the result ist the orangish polygon in the attached screen.

..ede

On 19.07.2012 17:52, Arnd Kielhorn wrote:
GGAtext3.test3.txt
test.png

edgar....@web.de

unread,
Jul 20, 2012, 6:48:23 AM7/20/12
to openjum...@googlegroups.com
On 20.07.2012 12:39, edgar....@web.de wrote:
> a smaller data set seems to work, which lets me assume that the points have the correct order in the csv file and something fishy goes on during merging.

i am not so sure about that no more. just tried a bigger test data set and there seem to be point in correct order for a linestring but others jump from one side of the figure to the other.

..ede

edgar....@web.de

unread,
Jul 20, 2012, 6:49:10 AM7/20/12
to openjum...@googlegroups.com
On 20.07.2012 12:39, edgar....@web.de wrote:
> a smaller data set seems to work, which lets me assume that the points have the correct order in the csv file and something fishy goes on during merging.

i am not so sure about that no more. just tried a bigger test data set and there seem to be point in correct order for a linestring but others jump from one side of the figure to the other.

forgot the screenshot (see attached)

..ede
outoforder.png

edgar....@web.de

unread,
Jul 20, 2012, 2:34:42 PM7/20/12
to openjum...@googlegroups.com
right seems to be part of PLUS.. ede

Stefan Steiniger

unread,
Jul 24, 2012, 2:09:44 PM7/24/12
to openjum...@googlegroups.com
Hi Arnd,

so I finally had a look at it too, something I tried with connecting the
points based on the order did not work, as for ede.

I see what you mean, and what may work is a delauney triangulation based
approach. I.e. what you want is indeed the concave hull. Unfortunately
we do not expose the delauney triangulation when we compute Voronoi
polygons (or did Michael just do this lately on SVN? I don't find it in
1.5.2).

And then, based on the generated graph one could calculate a minimum
spanning tree (MST). That would result in a something like a concave
hull for your example. Or one writes an algorithm that connects to the
point that is closest, given a start point.

Not super difficult with the JTS Delauney trinagulation algorithm we
have, but would take at least a day or two to program???

stefan


Am 19.07.12 11:52, schrieb Arnd Kielhorn:

Arnd Kielhorn

unread,
Jul 25, 2012, 8:42:08 AM7/25/12
to openjum...@googlegroups.com
Hello Stefan,

thanks a lot for the investigation. I think a concave hull may describe it in the best way.
The way to connect the nearest point should not bring the best result in many cases. So the distinction could described as:

- concave hull brings a good result independly if there are not only points on a virtual border but also within the area
- finding nearest point solution should only work when there are no points within the gps measured area.

Both could be interesting, but it seems that the concave hull is a more general approach so it should work in nearly most cases.

Greetings
Arnd

edgar....@web.de

unread,
Jul 25, 2012, 8:43:43 AM7/25/12
to openjum...@googlegroups.com
Arnd,

any idea why the order is of the points is so weird? .. ede

Arnd Kielhorn

unread,
Jul 26, 2012, 3:30:19 AM7/26/12
to openjum...@googlegroups.com
Hi Ede,

I am sorry have no idea. When there was allway an stringent order in all those datasets I will be able to connect the point by an attribut like ID or timestamp. But from source to source I get different orders...so I think a concave hull should be like a general tool.

Kindly regards
Arnd

Stefan Steiniger

unread,
Jul 28, 2012, 7:40:03 PM7/28/12
to openjum...@googlegroups.com
Hi Arnd,

I may have good news for you. I remembered yesterday that Eric made a
Concave Hull implementation. I just tested it with your data, and it may
work for you (at least for the case you did send).

However, the concave hull implementation has a parameter that defines
the maximal distance, I suppose, that a triangle side can have. So when
I used your data, in Lat/Lon, and used the default value of 10.0 for the
parameter, I can basically a convex hull. However, when I measured the
triangle side distance was about 0.002 degrees. Hence, I changed the
parameter value to 0.0005. And, voila!, I got something that was really
close to what you want.
Though, not sure if it work in any of your cases and if you would need
to do some post-modification to the generated hull. But I think its a
good start (if you find the right parameter value; maybe transforming it
from "degree" to "m" helps too ;).

you can get the convex hull plugin for OJ here:
http://www.rotefabrik.free.fr/concave_hull/

I did put both jar filed in OJs /ext/ folder.

cheers,
stefan

Am 26.07.12 03:30, schrieb Arnd Kielhorn:
Reply all
Reply to author
Forward
0 new messages