Hi,
Your algo is not very simple because each circle may have several
intersection with the polyline.
I would proceed as follow.
put first coordinate in a list
create circle around it
segment = first segment
while (nextSegment = true) {
if circle intersects segment, put intersection coordinate in the list
nextSegment
}
The code you need in mostly in JTS :
Coordinate
Geometry
GeometryFactory
GeometryShapeFactory
To get a layer and iterate through features, you can see examples in
lib\ext\BeanTools directory
To write/test/execute beanshell script, I recommend BeanshellEditor
downloadable from http://openjump.org/wiki/show/Plugins
Michaël
Cristian Cerb a écrit :
Still great, no excuse :)
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Stefan
Steiniger
Sent: Tuesday, February 24, 2009 9:33 AM
To: JUMP Users Discussion
Subject: Re: [jump-users] question about scripting in JUMP
well.. that depends on the day (weekends) and the question. Starter
questions are usually fast to answer by sending links around ;)
stefan
Cristian Cerb schrieb:
I'm impressed how fast a feedback people get here! Great!
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Sunburned
Surveyor
Sent: Tuesday, February 24, 2009 9:08 AM
To: JUMP Users Discussion
Subject: Re: [jump-users] question about scripting in JUMP
Thanks Stefan...I forgot about Jython.
SS
On Tue, Feb 24, 2009 at 8:53 AM, Stefan Steiniger <[email protected]>
wrote:
Hei Dimitri,
another additional comment.
If you download the latest nightly built of OpenJUMP here:
http://jump-pilot.sourceforge.net/download/nightlybuild/
bzw this is the last version:
http://jump-pilot.sourceforge.net/download/nightlybuild/openjump-core-1.2-20
090224-bin.zip
then you have two options for scripting: Beanshell scripts and
Jython(=Python in Java) scripts. Example scripts for both can be found in
the folder /lib/ext/...
However, you need to know a bit the "classes" that OpenJUMP or JTS has -
i.e. your circles would use a buffer operation on a point, where the
buffer
operations is function of JTS. See for instance here:
http://www.openjump.org/wiki/show/Example+Plugin+For+Buffering+Features+in+a
+Layer
However, this example on the webpage is a real "plugin" so some things
will
be different compared to scripts.
I hope this helps?
stefan
PS: Oh.. I just see that you wrote on the JUMP user list. JUMP is
basically
not anymore maintained a couple of volunteers started with OpenJUMP:
www.openjump.org - However, I need to add that some of the plugins for
the
original JUMP are not working with OpenJUMP (especially the ones from the
jump-project.org website)
Zmitser Kozhukh schrieb:
Hello!
I have just started to use JUMP and aquaint myself with programming.
So wanted to ask if someone can help me to write some simple script. For
example, I have some line with points. Than I want to select starting
point
from this line, than to draw a circle with some fixed radius centered at
that point, than connect with straight line initial point and point of
intersection (between drawn circle and the line). Than do the same thing
,
i.e. to draw circle around the point of intersection, connect it with
new
intersection point and so on... So anyone who knows how to script it
please
help. Or if someone knows some helpfull resources about scripting in
JUMP
please let me know.
Thank you in advance!
Dmitrii
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users