Need Guidance on Modifying Shapes

4 messages Options
Embed this post
Permalink
ayc

Need Guidance on Modifying Shapes

Reply Threaded More More options
Print post
Permalink
Hello All,

I'm a beginner at GIS programs and I need some help. I'm trying to create a program where I can morph the size of the states, countries. For example, I want to make the area of California 3x bigger and Nevada 2x smaller, yet keeping the border between California and Nevada intact so there are no spaces.

I have worked through all the demo examples and I need some advice on the direction.

I would read in a CVS and match with each Feature string name, a ratio that I would apply to modify the corresponding polygon of that feature. I would then modify a certain sides of a polygon to make them bigger and smaller.

Is this a good way to do it or is there a better way to go about it?
Also is there any good tutorials on polygon manipulation that you guys would recommend?
I am awfully sorry about the inexperience in this field,
but Thanks in Advance.

-Andrew
mbedward

Re: Need Guidance on Modifying Shapes

Reply Threaded More More options
Print post
Permalink
Hello Andrew,

Nice question :-)

I'm not sure that I understand exactly what you're after. In your
example with two adjoining polygons, do you want to keep their common
border unchanged and only move vertices on other parts of each
polygon's exterior ?

My first thought would be to reach for a standard java AffineTransform
to do that, set up to scale the polygon area as required. I can
imagine there are lots of fiddly bits that will crop up though !
Expanding or reducing an isolated polygon is easy - just standardize
the vertex coords by taking the polygon centroid as (0,0) and multiply
them by the desired factor.  The common boundary bit is an interesting
complication though.

Perhaps there is some way of treating the non-common border component
of each polygon as an elastic cable... for instance, by iteratively
moving each vertex towards (decreasing area) or away from (increasing
area) the centroid of the polygon and monitoring the change in polygon
area. Mmm... even as I type that it's starting to sound unnecessarily
complicated.

One thing you might not know is that GeoTools relies on another
library for it's geometry classes and operations: JTS (Java Topology
Suite).  There is a JTS discussion list where people are very
friendly: if you haven't already I'd recommend posting the same
question there to double your chances of getting a useful answer.

You can search the archive of the JTS list here:
http://n2.nabble.com/jts-devel-f219725.html

And join the list to post on it here:
http://lists.refractions.net/mailman/listinfo/jts-devel

(Don't be put off by the list description being about JTS development
- it's a general discussion list as well).

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
ayc

Re: Need Guidance on Modifying Shapes

Reply Threaded More More options
Print post
Permalink
Thanks for the reply. Your input is very helpful. :)
Just to clarify the border between California and Nevada can be changed (1x bigger).


mbedward

Re: Need Guidance on Modifying Shapes

Reply Threaded More More options
Print post
Permalink
Hi Andrew,

> Just to clarify the border between California and Nevada can be changed (1x
> bigger).

1 x bigger ? Does that mean 2 x present length ?

Anyway, it looks like you have a very promising lead from jts-devel.

For list members here, there is an app called Scape Toad that appears
capable of constrained morphing of polygons...

http://scapetoad.choros.ch/

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users