Skip to content

Commit

Permalink
Merge pull request #2 from evetion/up
Browse files Browse the repository at this point in the history
update to a working FlatBuffers for 1.7
  • Loading branch information
evetion authored Dec 15, 2021
2 parents 7a136bc + a55e728 commit 7a06b63
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 111 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.2'
- '1.5'
- '1.6'
- '1'
- 'nightly'
os:
- ubuntu-latest
Expand Down
89 changes: 0 additions & 89 deletions Manifest.toml

This file was deleted.

4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ FlatBuffers = "53afe959-3a16-52fa-a8da-cf864710bae9"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[compat]
julia = "1.2"
FlatBuffers = "0.5"
FlatBuffers = "0.6"
Tables = "1.2"
julia = "1.6"
2 changes: 1 addition & 1 deletion src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function skipmagic(io::IO)
magic[2] == 0x67 &&
magic[3] == 0x62 &&
magic[4] == 0x03 ||
error("File has wrong headar")
error("File has wrong header")
end


Expand Down
4 changes: 2 additions & 2 deletions src/schema/feature.fbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// From https://github.com/bjornharrtell/flatgeobuf/blob/master/src/fbs/header.fbs
include "header.fbs";
// namespace FlatGeobuf;

namespace FlatGeobuf;

table Geometry {
ends: [uint]; // Array of end index in flat coordinates per geometry part
Expand All @@ -20,4 +21,3 @@ table Feature {
}

root_type Feature;

14 changes: 7 additions & 7 deletions src/schema/header.fbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// From https://github.com/bjornharrtell/flatgeobuf/blob/master/src/fbs/header.fbs
// namespace FlatGeobuf;
namespace FlatGeobuf;

// Geometry type enumeration
// Geometry type enumeration
// NOTE: Same as WKB 2D geometry type enumeration
enum GeometryType: ubyte {
Unknown = 0,
Expand All @@ -11,7 +11,7 @@ enum GeometryType: ubyte {
MultiPoint = 4,
MultiLineString = 5,
MultiPolygon = 6,
GeometryCollection = 7,
GeometryCollection = 7,
CircularString = 8,
CompoundCurve = 9,
CurvePolygon = 10,
Expand Down Expand Up @@ -69,10 +69,10 @@ table Header {
name: string; // Dataset name
envelope: [double]; // Bounds
geometry_type: GeometryType; // Geometry type (should be set to Unknown if per feature geometry type)
hasZ: bool = false; // Does geometry have Z dimension?
hasM: bool = false; // Does geometry have M dimension?
hasT: bool = false; // Does geometry have T dimension?
hasTM: bool = false; // Does geometry have TM dimension?
has_z: bool = false; // Does geometry have Z dimension?
has_m: bool = false; // Does geometry have M dimension?
has_t: bool = false; // Does geometry have T dimension?
has_tm: bool = false; // Does geometry have TM dimension?
columns: [Column]; // Attribute columns schema (can be omitted if per feature schema)
features_count: ulong; // Number of features in the dataset (0 = unknown)
index_node_size: ushort = 16; // Index node size (0 = no index)
Expand Down
8 changes: 4 additions & 4 deletions src/schema/header.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ FlatBuffers.@with_kw mutable struct Header
name::String = ""
envelope::Vector{Float64} = []
geometry_type::GeometryType = 0
hasZ::Bool = false
hasM::Bool = false
hasT::Bool = false
hasTM::Bool = false
has_z::Bool = false
has_m::Bool = false
has_t::Bool = false
has_tm::Bool = false
columns::Vector{Column} = []
features_count::UInt64 = 0
index_node_size::UInt16 = 16
Expand Down
5 changes: 3 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
FlatBuffers = "53afe959-3a16-52fa-a8da-cf864710bae9"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"
5 changes: 3 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ using FlatGeobuf
using FlatBuffers
using Tables
using TypedTables
using Downloads

@testset "FlatGeobuf" begin
fna = "countries.fgb"
fnb = "UScounties.fgb"
isfile(fna) || download("https://github.com/bjornharrtell/flatgeobuf/blob/master/test/data/countries.fgb?raw=true", fna)
isfile(fnb) || download("https://github.com/bjornharrtell/flatgeobuf/blob/master/test/data/UScounties.fgb?raw=true", fnb)
isfile(fna) || Downloads.download("https://github.com/bjornharrtell/flatgeobuf/blob/master/test/data/countries.fgb?raw=true", fna)
isfile(fnb) || Downloads.download("https://github.com/bjornharrtell/flatgeobuf/blob/master/test/data/UScounties.fgb?raw=true", fnb)

@testset "Construction" begin
crs = FlatGeobuf.Crs("epsg", 28992, "RD New", "Dutch grid", "proj+=asdas", "codestring")
Expand Down

0 comments on commit 7a06b63

Please sign in to comment.