google-code-export / nettopologysuite

Automatically exported from code.google.com/p/nettopologysuite
1 stars 0 forks source link

Defect in clone of Envelope #179

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the Clone() metohd on a 'NULL' envelope
2. The result won't be a 'NULL' envelope

What is the expected output? What do you see instead?
The result is a new Envelope with (0,-1,0,-1) properties with no 'NULL' 
attribute, as the original it was cloned from

What version of the product are you using? On what operating system?
Latest release on Windows 7 64 bit (I've checked and it seems the trunk version 
has the same defect)

Please provide any additional information below.
I've used the following fix for the Clone() method:

if (this.IsNull)
{
  return new Envelope(); // this will create a new 'NULL' envelope
}
return new Envelope(_minx, _maxx, _miny, _maxy);

Original issue reported on code.google.com by shme...@gmail.com on 29 Mar 2014 at 7:07

GoogleCodeExporter commented 9 years ago
Clone method is not from JTS, so I haven't a direct comparison with JTS 
specifications. Anyway, kooks a reasonable change to me.

Original comment by diegogu...@gmail.com on 31 Mar 2014 at 10:17

GoogleCodeExporter commented 9 years ago
fixed with changeset 74135: 
https://geoapi.codeplex.com/SourceControl/changeset/74135

Original comment by diegogu...@gmail.com on 31 Mar 2014 at 10:18