Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Fill Area tool does not give correct results always

Hi Suryakant,
that is quite one interesting issue.

I am wondering if that is a problem of precision model. In your case you are using very wide lat long coordinates, which might lead at that level of non-detail to some rounding issues in the JTS results?
Can you try the same in a reprojected system?

I tried to check the geometries you report in the JTS testbuilder and they already have the extra lines.

Let me know how the tests go, I will check also as soon as I can.

Andrea





On Wed, Jan 30, 2013 at 6:08 AM, suryakant bhagat <suryavesitb@xxxxxxxxxxx> wrote:
Hi,
    I am using 2 tools as follows.
1. Create Polygon Tool ==> I draw a polygon. I have numbered it as 1 in the attached image.
2. Fill Area Tool ==> I use the fill tool and complete filling area marked 2 in the attached image. I again use the fill tool and complete filling area marked 3 in the attached image.
    Now the resultant polygon marked 3 is incorrectly filled. The resultant polygon has an extra line(highlighted in the image) which should not be present in the resultant polygon. 
I did a walkthrough of the code to understand the cause. I debugged the method
runDifferenceOp in the class DifferenceFeatureCommand. After I complete filling area marked 3 in the attached image, I get following results.
1. The createdGeometry is POLYGON ((-67.39088271309409 27.934044647914646, -74.37439387507274 60.75654710921435, -55.16973817963144 83.10378282754607, -16.062075672550947 67.39088271309407, -13.967022323957337 37.36178471658584, -24.791464625024247 9.427740068671199, -67.39088271309409 27.934044647914646))
 
2. The existingGeometry is POLYGON ((-47.951394159917214 44.09570912400787, -53.07468483103783 53.77303594723569, -12.221144533462677 57.61396708632395, 27.584869089815697 29.33074688031038, 15.0145489982541 -14.316197882056258, -9.15177506194378 3.405773095422192, 0.3491755580989206 3.840931139088269, -45.392822552861304 1.7458777904946743, -82.40543171134821 5.237633371483994, -85.19883617613966 43.64694476236663, -27.235693531716777 44.3452958785645, -47.951394159917214 44.09570912400787))
 
3. The differenceGeometry is POLYGON ((-70.77103782166621 43.82077365820366, -74.37439387507274 60.75654710921435, -55.16973817963144 83.10378282754607, -16.062075672550947 67.39088271309407, -15.359380547632652 57.3189192559319, -53.07468483103783 53.77303594723569, -47.951394159917214 44.09570912400787, -27.235693531716777 44.3452958785645, -70.77103782166621 43.82077365820366))
 
The difference calculated is incorrect. It is not as per the definition of the method given in the api. I am quoting the api definition here(com.vividsolutions.jts.geom.Geometry).
--------------------------------------------------------------------------------------------------------------------------------

difference

public Geometry difference(Geometry other)
Computes a Geometry representing the points making up this Geometry that do not make up other. This method returns the closure of the resultant Geometry.
Parameters:
other - the Geometry with which to compute the difference
Returns:
the point set difference of this Geometry with other
-----------------------------------------------------------------------------------------------------------------------------------
Is it a bug or I am wrong in my undersatnding. Also, how do I correct it? Please let me know.
 
 
Thanks and Regards,
Suryakant B

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel



Back to the top