Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GaiaGeoReader.Read(byte[] blob) throws an exception in case the envelope Coordinates contain double.NaN #10

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/NetTopologySuite.IO.SpatiaLite/GaiaGeoReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ public Geometry Read(byte[] blob)
// break;
//};
offset = 6;
var env = new Envelope(gaiaImport.GetDouble(blob, ref offset),
gaiaImport.GetDouble(blob, ref offset),
gaiaImport.GetDouble(blob, ref offset),
gaiaImport.GetDouble(blob, ref offset));

//the next four values are the envelope, but it is not required here
//consider that if the values contain double.NaN
//the NetTopologySuite.Geometries.Envelope constructor might fail

for (int i = 0; i != 4; ++i)
{
gaiaImport.GetDouble(blob, ref offset);
}

offset = 39;
var type = (GaiaGeoGeometry)gaiaImport.GetInt32(blob, ref offset);
Expand Down