-
Notifications
You must be signed in to change notification settings - Fork 22
Geopackage reader #174
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 reader #174
Changes from 10 commits
6aae933
53a4b88
43a87af
91ed1ef
3166a1c
0255232
5e60488
39730ce
26b7602
0077fef
de56781
6c3c505
5dc18fb
46b20b9
6538130
e93f91c
d73a169
1cf927e
4201eb2
f401635
82d635a
acc948c
dc722cc
f7e4e85
b2451b1
31d9cba
a884e88
e9cd713
6d2244c
7cd4851
f98d6b6
ddd08d5
b058783
347fe4b
4de2764
97a03e2
f98563c
9db3590
9d6574f
0a12360
41e73d2
3e4b02e
0ee3192
8ad4c2a
c1ec60d
c0c06a4
ff406c0
ec9de5a
c23fdb2
59428a4
62c9393
e4a40f0
a83e48b
7e43151
ed4bb0c
57f3a66
72335cd
97ca89f
694853a
b99a299
c47aeeb
1ad329c
db61a1c
00e988d
00a5290
fb6ef04
79560a3
f3dce85
12a2597
76193b6
6aba388
3dd8bda
d604a94
c563881
0b52233
ed7ac0c
99a37da
435f6bb
7751cd1
c1a2ea7
7399fa2
ef477bb
b912fa8
2aa6ce0
5efb822
f0ff9b2
2a012bc
bd2a0ed
b154726
f2fcb78
0ead8f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -38,6 +38,10 @@ import PlyIO | |||||
| # CSV format | ||||||
| import CSV | ||||||
|
|
||||||
| # Database interfaces | ||||||
| import DBInterface | ||||||
| import SQLite | ||||||
|
Comment on lines
+42
to
+43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Asked a question that was not answered about the need of importing these two.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left this as my answer to the previous comment This is taken from the docstring for SQLite.execute
...
|
||||||
|
|
||||||
| # geostats formats | ||||||
| import GslibIO | ||||||
|
|
||||||
|
|
@@ -72,7 +76,7 @@ const CDMEXTS = [".grib", ".nc"] | |||||
| const FORMATS = [ | ||||||
| (extension=".csv", load="CSV.jl", save="CSV.jl"), | ||||||
| (extension=".geojson", load="GeoJSON.jl", save="GeoJSON.jl"), | ||||||
| (extension=".gpkg", load="ArchGDAL.jl", save="ArchGDAL.jl"), | ||||||
| (extension=".gpkg", load="GeoIO.jl", save="GeoIO.jl"), | ||||||
|
||||||
| (extension=".gpkg", load="GeoIO.jl", save="GeoIO.jl"), | |
| (extension=".gpkg", load="GeoIO.jl", save="ArchGDAL.jl"), |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # ------------------------------------------------------------------ | ||
| # Licensed under the MIT License. See LICENSE in the project root. | ||
| # ------------------------------------------------------------------ | ||
|
|
||
| # According to https://www.geopackage.org/spec/#r2 | ||
| # a GeoPackage should contain "GPKG" in ASCII in | ||
| # "application_id" field of SQLite db header | ||
| const GP10_APPLICATION_ID = Int(0x47503130) | ||
| const GP11_APPLICATION_ID = Int(0x47503131) | ||
| const GPKG_APPLICATION_ID = Int(0x47504B47) | ||
| const GPKG_1_2_VERSION = 10200 | ||
| const GPKG_1_3_VERSION = 10300 | ||
| const GPKG_1_4_VERSION = 10400 | ||
|
|
||
| # types used within the GeoPackageBinary SQL BLOBs | ||
| @enum wkbGeometryType begin | ||
|
||
| wkbUnknown = 0 | ||
| wkbPoint = 1 | ||
| wkbLineString = 2 | ||
| wkbPolygon = 3 | ||
| wkbMultiPoint = 4 | ||
| wkbMultiLineString = 5 | ||
| wkbMultiPolygon = 6 | ||
| wkbGeometryCollection = 7 | ||
| wkbCircularString = 8 | ||
| wkbCompoundCurve = 9 | ||
| wkbCurvePolygon = 10 | ||
| wkbMultiCurve = 11 | ||
| wkbMultiSurface = 12 | ||
| wkbCurve = 13 | ||
| wkbSurface = 14 | ||
|
|
||
| wkbNone = 100 # pure attribute records | ||
| wkbLinearRing = 101 | ||
|
|
||
| # ISO SQL/MM Part 3: Spatial | ||
| # Z-aware types | ||
| wkbPointZ = 1001 | ||
| wkbLineStringZ = 1002 | ||
| wkbPolygonZ = 1003 | ||
| wkbMultiPointZ = 1004 | ||
| wkbMultiLineStringZ = 1005 | ||
| wkbMultiPolygonZ = 1006 | ||
| wkbGeometryCollectionZ = 1007 | ||
| wkbCircularStringZ = 1008 | ||
| wkbCompoundCurveZ = 1009 | ||
| wkbCurvePolygonZ = 1010 | ||
| wkbMultiCurveZ = 1011 | ||
| wkbMultiSurfaceZ = 1012 | ||
| wkbCurveZ = 1013 | ||
| wkbSurfaceZ = 1014 | ||
|
|
||
| # ISO SQL/MM Part 3. | ||
| # M-aware types | ||
| wkbPointM = 2001 | ||
| wkbLineStringM = 2002 | ||
| wkbPolygonM = 2003 | ||
| wkbMultiPointM = 2004 | ||
| wkbMultiLineStringM = 2005 | ||
| wkbMultiPolygonM = 2006 | ||
| wkbGeometryCollectionM = 2007 | ||
| wkbCircularStringM = 2008 | ||
| wkbCompoundCurveM = 2009 | ||
| wkbCurvePolygonM = 2010 | ||
| wkbMultiCurveM = 2011 | ||
| wkbMultiSurfaceM = 2012 | ||
| wkbCurveM = 2013 | ||
| wkbSurfaceM = 2014 | ||
|
|
||
| # ISO SQL/MM Part 3. | ||
| # ZM-aware types ... Meshes.jl doesn't generally support this? | ||
|
||
| wkbPointZM = 3001 | ||
| wkbLineStringZM = 3002 | ||
| wkbPolygonZM = 3003 | ||
| wkbMultiPointZM = 3004 | ||
| wkbMultiLineStringZM = 3005 | ||
| wkbMultiPolygonZM = 3006 | ||
| wkbGeometryCollectionZM = 3007 | ||
| wkbCircularStringZM = 3008 | ||
| wkbCompoundCurveZM = 3009 | ||
| wkbCurvePolygonZM = 3010 | ||
| wkbMultiCurveZM = 3011 | ||
| wkbMultiSurfaceZM = 3012 | ||
| wkbCurveZM = 3013 | ||
| wkbSurfaceZM = 3014 | ||
|
|
||
| # 2.5D extension as per 99-402 | ||
| # https://lists.osgeo.org/pipermail/postgis-devel/2004-December/000702.html | ||
|
|
||
| # Julia throws InexactError: convert(Int32, 0x8000000x) | ||
jph6366 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| wkbPoint25D = -2147483647 # 0x80000001 | ||
| wkbLineString25D = -2147483646 # 0x80000002 | ||
| wkbPolygon25D = -2147483645 # 0x80000003 | ||
| wkbMultiPoint25D = -2147483644 # 0x80000004 | ||
| wkbMultiLineString25D = -2147483643 # 0x80000005 | ||
| wkbMultiPolygon25D = -2147483642 # 0x80000006 | ||
| wkbGeometryCollection25D = -2147483641 # 0x80000007 | ||
| end | ||
|
|
||
| include("gpkg/read.jl") | ||
| include("gpkg/write.jl") | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need both dependencies? Could you please elaborate on the rationale for using SQLite.jl and DBInterface.jl in different places of the code? Convenience? DBInterface.jl provides higher-level constructs that justify its use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQLite.execute(db, stmt)executes but returns nothing