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

Geopackage Point problem #11

Open
Boerme84 opened this issue Oct 23, 2024 · 1 comment
Open

Geopackage Point problem #11

Boerme84 opened this issue Oct 23, 2024 · 1 comment
Assignees
Labels

Comments

@Boerme84
Copy link

Boerme84 commented Oct 23, 2024

When creating a single point, an 32 byte empty envelope is also created in the GeoPackage header:

var GeometryFactory = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(25832);
var coord = new Coordinate(10, 20);
var pnt = GeometryFactory.CreatePoint(coord);
var writer = new GeoPackageGeoWriter
{
    HandleOrdinates = Ordinates.XY   
};

byte[] bytes = writer.Write(pnt);

The problem here is that flags (value is 3) is set to include a 32 byte envelope, with all zeros (see GeopackageHeader definition below)

//definition from geopackage.org
GeoPackageBinaryHeader {
  byte[2] magic = 0x4750; 
  byte version;           
  byte flags;             
  int32 srs_id;           
  double[] envelope;      
}

So how do you set the values min/max values for the envelope ?

Also it would be nice to exclude the envelope entirely to save space, but this is only possible when ordinates is set to Ordinate.None. But Ordinate.None is enterpreted as Ordinates.XY, so it seems that this is not possible.

QGIS will only read the point layer correctly if min/max envelope values are set for the points, or if envelope is excluded.

System Configuration

  • NetTopologySuite version: 2.0.0
  • Other NetTopologySuite packages and versions: NetTopologySuite.IO.GeoPackage 2.0.0
    Windows 10 Entrerprise
    .NET 6.0
@FObermaier FObermaier transferred this issue from NetTopologySuite/NetTopologySuite Oct 31, 2024
@FObermaier FObermaier added the bug label Oct 31, 2024
@FObermaier FObermaier self-assigned this Oct 31, 2024
@FObermaier
Copy link
Member

@Boerme84 could you check if the current fix addresses your issue correctly? TIA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants