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 Andrea,
             Has the replication after zooming out given any clue? I guess the issue lies in the difference method. What do you think?


Suryakant B



--- On Thu, 31/1/13, suryakant bhagat <suryavesitb@xxxxxxxxxxx> wrote:

From: suryakant bhagat <suryavesitb@xxxxxxxxxxx>
Subject: Re: [udig-devel] Fill Area tool does not give correct results always
To: "User-friendly Desktop Internet GIS" <udig-devel@xxxxxxxxxxxxxxxxxxxxx>
Date: Thursday, 31 January, 2013, 4:08 PM

Hi Andrea,
             I replicated the same issue after zooming. I got following results:
1. Created Geometry :POLYGON ((-136.36207894120835 70.82320538055232, -136.36208094140173 70.82320527169826, -136.36207926777053 70.82320298576306, -136.36207793430827 70.82320284969549, -136.36207683216088 70.82320442807932, -136.36207894120835 70.82320538055232))

2. Existing Geometry :MULTIPOLYGON (((-136.36207691384476 70.82320209866847, -136.3620769138448 70.82320209866847, -136.3620768593744 70.82320055015353, -136.36208075090713 70.82320084950219, -136.3620800569625 70.82320378856173, -136.3620789548151 70.8232048498888, -136.36207917475403 70.82320463809577, -136.3620794718719 70.82320604728342, -136.36207832890423 70.82320574793476, -136.362078166789 70.82320559683706, -136.36207570279998 70.82320546219286, -136.36207260045921 70.82320260477387, -136.36207526738374 70.82320037326569, -136.36207690696492 70.82320190308404, -136.36207691384476 70.82320209866847)), ((-137.52380967661375 69.71428579174602, -160.00000017777776 67.80952388486772, -162.28571446603172 87.61904771640211, -145.52380968550264 90.6666667674074, -129.1428572863492 77.71428580063491, -137.52380967661375 69.71428579174602)))

3. Difference Geometry :POLYGON ((-136.36207993882437 70.82320390232437, -136.36208094140173 70.82320527169826, -136.3620793268708 70.82320535956389, -136.36207917475403 70.82320463809577, -136.3620789548151 70.8232048498888, -136.36207993882437 70.82320390232437))

I have also attached the image which shows the erroneous extra line attached to the polygon(highlighted in the image).

Suryakant B

--- On Thu, 31/1/13, andrea antonello <andrea.antonello@xxxxxxxxx> wrote:

From: andrea antonello <andrea.antonello@xxxxxxxxx>
Subject: Re: [udig-devel] Fill Area tool does not give correct results always
To: "User-friendly Desktop Internet GIS" <udig-devel@xxxxxxxxxxxxxxxxxxxxx>
Date: Thursday, 31 January, 2013, 12:51 PM


             Thanks for replying back. As suggested by you, I can try the same in a reprojected system. But, which coordinate system should I use(there are may u know)? I had reported the issue using the coordinate system GEOG/WGS 84.

Well, you could try any UTM of your zone, for which you have data.
Another test would be to zoom at a major level of detail, i.e. still in lat/long but at a higher zoom in. Can for exampke zoom to the level of detail of your house and try there?

Cheers,
Andrea

 



Suryakant B

--- On Wed, 30/1/13, andrea antonello <andrea.antonello@xxxxxxxxx> wrote:

From: andrea antonello <andrea.antonello@xxxxxxxxx>
Subject: Re: [udig-devel] Fill Area tool does not give correct results always
To: "User-friendly Desktop Internet GIS" <udig-devel@xxxxxxxxxxxxxxxxxxxxx>
Date: Wednesday, 30 January, 2013, 11:39 AM


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



-----Inline Attachment Follows-----


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

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



-----Inline Attachment Follows-----

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

-----Inline Attachment Follows-----

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

Back to the top