Skip to content

Commit 2f7fe9d

Browse files
authored
Merge pull request #63 from JuliaGeo/feat/typed-everything
Rewrite using JSON3(read, Type)
2 parents 3d84c62 + 439c90a commit 2f7fe9d

14 files changed

+1114
-623
lines changed

Project.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
name = "GeoJSON"
22
uuid = "61d90e0f-e114-555e-ac52-39dfb47a3ef9"
3-
authors = ["Martijn Visser <[email protected]>", "Rafael Schouten <[email protected]>"]
4-
version = "0.6.4"
3+
authors = ["Martijn Visser <[email protected]>", "Rafael Schouten <[email protected]>", "Maarten Pronk <[email protected]>"]
4+
version = "0.7.0"
55

66
[deps]
77
Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
88
GeoFormatTypes = "68eda718-8dee-11e9-39e7-89f7f65f511f"
99
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
1010
GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a"
1111
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
12+
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
1213
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1314

1415
[compat]
1516
Aqua = "0.5"
1617
Extents = "0.1"
1718
GeoFormatTypes = "0.4"
18-
GeoInterface = "1"
19+
GeoInterface = "1.2.1"
1920
GeoInterfaceRecipes = "1"
2021
JSON3 = "1.12"
22+
StructTypes = "1"
2123
Tables = "1"
2224
julia = "1.6"
2325

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ does the same thing for the general JSON format. GeoJSON puts the geometry in a
1212
properties in the columns individually.
1313

1414
## Usage
15+
GeoJSON only provides simple `read` and `write` methods.
1516

1617
```julia
1718
julia> using GeoJSON, DataFrames
@@ -26,9 +27,15 @@ Feature with geometry type Polygon and properties Symbol[:geometry, :timestamp,
2627

2728
# use the Tables interface to convert the format, extract data, or iterate over the rows
2829
julia> df = DataFrame(fc)
30+
31+
# write to string
32+
julia> write(fc)
33+
"{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-69.99693762899992...
2934
```
3035
31-
## HTTP access
36+
37+
38+
### HTTP access
3239
To read JSON from a URL, use HTTP.jl
3340
```julia
3441

src/GeoJSON.jl

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ module GeoJSON
66
Base.read(path, String)
77
end GeoJSON
88

9-
import Extents, GeoFormatTypes, GeoInterfaceRecipes, JSON3, Tables
9+
import Extents, GeoFormatTypes, GeoInterfaceRecipes, JSON3, Tables, StructTypes
1010
import GeoInterface as GI
1111

12-
include("geometries.jl")
13-
include("features.jl")
12+
include("geojson_types.jl")
1413
include("geointerface.jl")
15-
include("json.jl")
14+
include("io.jl")
15+
include("table.jl")
16+
include("utils.jl")
17+
include("precompile.jl")
1618

1719
end # module

src/features.jl

-257
This file was deleted.

0 commit comments

Comments
 (0)