ngageoint / geopackage-js

GeoPackage JavaScript Library
http://ngageoint.github.io/geopackage-js/
MIT License
311 stars 78 forks source link

Geopackage made from .dwg in QGis error No GEOMETRY column was found for table 'lines' #144

Closed efsjouw closed 4 years ago

efsjouw commented 4 years ago

Hello, I have created a .gpkg file from a .dwg file with QGis. Unfortunately I cannot show you the data itself.

When trying to load my file this error message appears in the console.

No GEOMETRY column was found for table 'lines'

So it seems rather obvious that it is missing a geometry column. I have also exported the data with QGis via a MySql plugin, I tried to make a pastebin of the dump but it is too large. The database does appear to have a reference to a "geom" column in a table called geometry_columns and the tables blocks and lines have geom columns filled with data of type geometry. The points table is empty.

I am basically trying to find out here whether the data we have acquired from our customer is wrong or that I am maybe doing something wrong. I don't really have any further experience with GeoPackages...

danielbarela commented 4 years ago

Are you able to share the GeoPackage with all of the data in the feature table removed? The issue is either the lines table does not have a geometry column, or, it does and this library is failing to read it properly.

efsjouw commented 4 years ago

Here is a link -snip-

with all of the data in the feature table removed?

I am not sure what you mean by this, when exporting to MySql there was no feature table present.

danielbarela commented 4 years ago

Sorry, I misunderstood. I thought you were unable to share the data in your GeoPackage. The issue is that some of your tables (lines, polylines, hatches) use extended geometries (COMPUNDCURVE, CURVEPOLYGON, CIRCULARSTRING). Those geometries are not supported by this library. However, that should not prevent the parsing of the GeoPackage, nor the showing of it on the viewer. I pushed a fix to the viewer which will continue to parse feature tables, and show the ones that it is able to. So you should be able to view the tables without the extended geometries now on the viewer. http://ngageoint.github.io/geopackage-js/ Let me know if that makes sense or you need anything else.

efsjouw commented 4 years ago

Wow thanks for the quick response, it does indeed seem to read more data now.

The issue is that some of your tables (lines, polylines, hatches) use extended geometries (COMPUNDCURVE, CURVEPOLYGON, CIRCULARSTRING).

What do you mean by this exactly? A quick search doesn't tell me much about "extended geometries".

danielbarela commented 4 years ago

http://www.geopackage.org/spec121/index.html#sql_geometry_types specifies the geometry types. The first 8 are supported by this library. We currently do not support anything beyond that as they are in an extension to the spec, not the core spec.

efsjouw commented 4 years ago

Ah okay that's quite clear to me only the MySql export that I made shows me the types POINT,LINESTRING and POLYGON in the geometry_columns table. I can see no mention of the types that you listed for some reason, but maybe they just don't get exported in this way.

Here is the dump file -snip-

danielbarela commented 4 years ago

Not sure what your MySql export is doing since a GeoPackage is a SQLite file, but when I open the GeoPackage in DB Browser Fro SQLite this is what the gpkg_geometry_columns table looks: Screen Shot 2020-03-13 at 8 19 07 AM