-
Notifications
You must be signed in to change notification settings - Fork 78
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
queryForGeoJSONFeaturesInTable throws an error for some geopackage files #139
Comments
I will check into this and get back to you soon. |
OK, so the problem is that the In the meantime you can call this: Let me know if this fixes your issue, but I will add the ability to pass in the projection, or maybe I will add the projection that the bounding box is in, to the BoundingBox that comes back from the featureDao.getBoundingBox method. Either way, what you are doing is totally valid and I will ensure that it works in the future. I will leave this open, in case there are other issues that come up due to the feature data being not in 4326. |
Thanks for that! The workaround with projectBoundingBox works and I can now load the data! There seems to be another issue where the feature geometry doesn't align with the map. For example, in the GeoPackage Viewer, the feature data from this geopackage file is displayed with a mismatch like this: And if I load it in Potree, the mismatch looks like this: I've actually been able to work around this issue in Potree by using the projection function from geopackage-js, rather than proj4.js, so this is how it's supposed to look: The issue manifests like this:
|
You can reproduce this projection discrepancy in the example page above if you set a breakpoint inside GeoPackageLoader.js line 92, Then execute this code in the dev tools:
output:
Proj4 strings from |
To create the proj4js projection, we will pass the WKT defined in the definition column of the gpkg_spatial_ref_sys table to proj4. Except in the case of 4326. So, it appears that the issue is, the definition in your GeoPackage is: When I modify your GeoPackage file and change the definition in the srs table to the above, the features are drawn in the correct location. |
Version: 2.1.0
First of all, thanks for this comprehensive geopackage library!
I recently ran into a problem with some geopackage files. Calling
queryForGeoJSONFeaturesInTable
results in the following error:The issue is, that point ends up being null in
geocentricToGeodetic
.The point becomes null during
datum_transform
after callinggeodeticToGeocentric
.And the reason is because the latitude is not in polar coordinates:
This is the location in my code where the error occurs:
https://github.com/potree/potree/blob/72748db38fd46a98c4d0800a70b1fe2570365152/src/loader/GeoPackageLoader.js#L92
Note that this looks a bit different than the official examples and the GeoPackage Viewer, because the version: 2.1.0 release seems to have a different API (no getFeatureRow() function, for example). What I'd like to accomplish is to load 3D data of all stored features, so that I can create 3D models out of them.
Here is an example that works:
3D Scene: http://mschuetz.potree.org/geopackage/examples/geopackage.html
Geopackage file: http://mschuetz.potree.org/geopackage/examples/morro_bay_shp/gpkg/geopackage.gpkg
And this is the geopackage that causes an error when loading with geopackage-js:
3D Scene: http://mschuetz.potree.org/geopackage/not_working/gpgp.html
Geopackage file: http://mschuetz.potree.org/geopackage/not_working/test2d_potree17_epsg2056.gpkg
Help on how to fix this issue or on how to correctly load 3D geometry data for features would be highly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: