Skip to content
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

Merge geojsontables #42

Merged
merged 58 commits into from
Jul 3, 2022
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
297d6b8
Initial commit
visr Aug 18, 2019
492878f
Files generated by PkgTemplates
visr Aug 18, 2019
b69b46e
First working version with some tests.
visr Aug 18, 2019
9c42e01
Hide too much output
visr Aug 18, 2019
1145c47
allow different properties per feature
visr Aug 18, 2019
9def41b
add usage note
visr Aug 18, 2019
b0abf0c
add link to GeoJSON PR
visr Aug 18, 2019
3856afa
subscribe to the GeoInterface
visr Aug 19, 2019
9f56068
add Travis CI
visr Aug 19, 2019
0ddab43
add GeoInterface Feature(Collection) constructors
visr Aug 19, 2019
c359c02
take the geometry out of the table
visr Aug 24, 2019
c011421
Install TagBot as a GitHub Action
JuliaTagBot Feb 8, 2020
b47c9db
Set up TagBot workflow
visr Dec 26, 2020
e2ea7e4
MassInstallAction: Install the CI workflow on this repository (#9)
visr Dec 26, 2020
54b156e
rename GeoInterface -> GeoInterphase
visr Oct 27, 2019
fe2cf8f
implement GeoInterface RFC
visr Oct 29, 2019
744d861
introduce geometry types that wrap the json
visr Oct 29, 2019
e7c7bf8
apply geointerface to the new geometry structs
visr Oct 30, 2019
f7bc741
switch geometry structs to only contain the JSON Array
visr Oct 31, 2019
825f16e
make Geometry an AbstractVector
visr Oct 31, 2019
dd1ac59
make sure we don't return raw JSON Arrays
visr Nov 1, 2019
33edc35
focus only on Int array indices for now
visr Nov 1, 2019
9046c31
rename GeoInterphase -> GeoInterfaceRFC
visr Nov 4, 2019
6e9b87b
isclosed has no i argument
visr Nov 13, 2019
6619871
update rfc
rafaqz Apr 30, 2022
274da20
implement features and geometries
rafaqz Apr 30, 2022
2d8d0b5
test multipolygon type
rafaqz Apr 30, 2022
a71a337
give CI a shot
visr Apr 30, 2022
b7ca54b
fix propertynames get
rafaqz Apr 30, 2022
c9a9ecb
use Extents.Extent for Feature and FeatureCollection
rafaqz May 1, 2022
42619e7
fix tests
rafaqz May 1, 2022
586e667
remove .travis; disable Windows CI for now; typo
visr May 1, 2022
6738ce3
reforganise and add missing interface methods
rafaqz May 18, 2022
b18fb30
reorganise and test interface
rafaqz May 18, 2022
89c249c
use FeatureTrait and FeatureCollectionTrait
rafaqz Jun 2, 2022
bce1bf3
Use FeatureCollection instead of a Vector
rafaqz Jun 2, 2022
29e6cd7
passing tests
rafaqz Jun 22, 2022
97359a4
dont use GeoInterface branch in CI
rafaqz Jun 22, 2022
14da4a1
run JuliaFormatter
visr Jun 24, 2022
4c3ed5f
=== nothing
visr Jun 24, 2022
6b4bdb2
remove double function definition
visr Jun 24, 2022
39cedb5
resolve ambiguity found by Aqua
visr Jun 24, 2022
be936e5
fix and test reading GeoformatTypes.GeoJSON
visr Jun 24, 2022
bea1932
indexing a FeatureCollection returns a Feature
visr Jun 25, 2022
11f32ff
always set crs to EPSG:4326
visr Jun 26, 2022
4ba0a36
support bbox for geometries
visr Jun 26, 2022
398cf5e
FeatureCollection add type parameter T<:Feature and features field
visr Jun 28, 2022
277f948
run JuliaFormatter
visr Jun 28, 2022
71ee4e9
namespace samples
visr Jun 28, 2022
ffb6583
test z coordinate in bbox
visr Jun 29, 2022
69aec66
constructors, tables interface, and tests
visr Jun 29, 2022
b2018a8
format under root testset
visr Jun 29, 2022
d16736d
Merge pull request #15 from visr/ok
rafaqz Jun 30, 2022
7f041d5
remove all GeoJSON.jl files
rafaqz Jun 30, 2022
33f34d6
Merge branch 'master' of ../GeoJSONTables into merge_geojsontables2
rafaqz Jun 30, 2022
d2a13c1
fix uuid
rafaqz Jun 30, 2022
ef5dd64
update authors
rafaqz Jun 30, 2022
70bc8f5
rename GeoJSONTables to GeoJSON
rafaqz Jun 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.6'
- '1'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
# - windows-latest # re-enable when new GeoInterface is released
arch:
- x64
steps:
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/CompatHelper.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/Documenter.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
/Manifest.toml
/dev/
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2019 Martijn Visser <mgvisser@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 0 additions & 22 deletions LICENSE.md

This file was deleted.

24 changes: 16 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
name = "GeoJSON"
uuid = "61d90e0f-e114-555e-ac52-39dfb47a3ef9"
license = "MIT"
version = "0.5.1"
name = "GeoJSONTables"
uuid = "b51d8a2e-9f51-4bbc-a3e6-443ab3727fd0"
authors = ["Martijn Visser <mgvisser@gmail.com>"]
version = "0.1.0"

[deps]
Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
GeoFormatTypes = "68eda718-8dee-11e9-39e7-89f7f65f511f"
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[compat]
GeoInterface = "0.4, 0.5"
JSON3 = "0.1.5, 1.0"
julia = "1"
Aqua = "0.5"
Extents = "0.1"
GeoFormatTypes = "0.4"
GeoInterface = "1"
JSON3 = "1"
Tables = "1"
julia = "1.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Aqua", "Test"]
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
# GeoJSON.jl
# GeoJSONTables

[![CI](https://github.com/JuliaGeo/GeoJSON.jl/workflows/CI/badge.svg)](https://github.com/JuliaGeo/GeoJSON.jl/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/JuliaGeo/GeoJSON.jl/badge.svg)](https://coveralls.io/r/JuliaGeo/GeoJSON.jl)
[![Latest Documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliageo.github.io/GeoJSON.jl/dev/)
Read [GeoJSON](https://geojson.org/) [FeatureCollections](https://tools.ietf.org/html/rfc7946#section-3.3) using [JSON3.jl](https://github.com/quinnj/JSON3.jl), and provide the [Tables.jl](https://github.com/JuliaData/Tables.jl) interface.

This library is developed independently of, but is heavily influenced in design by the [python-geojson](https://github.com/frewsxcv/python-geojson) package. It contains:
This package is unregistered and in development, so expect changes. It only supports reading, and only of FeatureCollections.

- Functions for encoding and decoding GeoJSON formatted data
- a type hierarchy (according to the [GeoJSON specification](http://geojson.org/geojson-spec.html))
- An implementation of the [\__geo_interface\__](https://gist.github.com/sgillies/2217756), a GeoJSON-like protocol for geo-spatial (GIS) vector data.
This package is heavily inspired by, and borrows code from, [JSONTables.jl](https://github.com/JuliaData/JSONTables.jl), which
does the same thing for the general JSON format. GeoJSONTables puts the geometry in a `geometry` column, and adds all
properties in the columns individually. The geometry and non-scalar properties are kept as JSON3.Object and JSON3.Array.
Right now that means the geometries are hard to use, but at least parsing is fast.

Note that GeoJSON.jl loads features into the GeoInterface.jl format and that this differs from GeoJSON in the following ways:
Going forward, it would be nice to try developing a GeoTables.jl, similarly to Tables.jl, but with special support
for a geometry column, that supports a diverse set of geometries, such as those of [LibGEOS](https://github.com/JuliaGeo/LibGEOS.jl), [Shapefile](https://github.com/JuliaGeo/Shapefile.jl), [ArchGDAL.jl](https://github.com/yeesian/ArchGDAL.jl/), [GeometryBasics](https://github.com/SimonDanisch/GeometryBasics.jl) and of course this package.

- Julia Geometries do not provide a `bbox` and `crs` method. If you wish to provide a `bbox` or `crs` attribute, wrap the geometry into a `Feature` or `FeatureCollection`.
- Features do not have special fields for `id`, `bbox`, and `crs`. These are to be provided (or found) in the `properties` field, under the keys `featureid`, `bbox`, and `crs` respectively (if they exist).
It would also be good to explore integrating this code into [GeoJSON.jl](https://github.com/JuliaGeo/GeoJSON.jl) and
archiving this package. See [GeoJSON.jl#23](https://github.com/JuliaGeo/GeoJSON.jl/pull/23) for discussion.

When saving GeoJSON, these transformations will be reversed: if `properties` has a key `featureid`, that will be removed from `properties` and a matching member `id` will be added to the Feature; similarly for `crs` and `bbox`.
## Usage

## Documentation
```julia
julia> using GeoJSONTables, DataFrames

Documentation for GeoJSON.jl can be found at https://juliageo.github.io/GeoJSON.jl/dev/.
julia> jsonbytes = read("path/to/a.geojson");

julia> fc = GeoJSONTables.read(jsonbytes)
FeatureCollection with 171 Features

julia> first(fc)
Feature with geometry type Polygon and properties Symbol[:geometry, :timestamp, :version, :changeset, :user, :uid, :area, :highway, :type, :id]

# use the Tables interface to convert the format, extract data, or iterate over the rows
julia> df = DataFrame(fc)
```
2 changes: 0 additions & 2 deletions docs/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions docs/Project.toml

This file was deleted.

11 changes: 0 additions & 11 deletions docs/make.jl

This file was deleted.

133 changes: 0 additions & 133 deletions docs/src/index.md

This file was deleted.

Loading