Comments (9)
Tests failed there https://github.com/simonw/geojson-to-sqlite/runs/5416550417?check_suite_focus=true because dirty-equals
isn't available for Python 3.6 - I'm going to drop 3.6 and add 3.10.
from geojson-to-sqlite.
Sounds like a good feature to me - a command-line option which means "bundle all of the properties into JSON in a column called properties
" perhaps.
Current options are:
~ % geojson-to-sqlite --help
Usage: geojson-to-sqlite [OPTIONS] DB_PATH TABLE GEOJSON
Import GeoJSON into a SQLite database
Options:
--nl Use newline-delimited GeoJSON features
--pk TEXT Column to use as a primary key
--alter Add any missing columns
--spatialite Use SpatiaLite
--spatial-index Create spatial indexes
--spatialite_mod TEXT Path to SpatiaLite module, for if --spatialite cannot
find it automatically
--help Show this message and exit.
I'm having trouble thinking of a good name for the new option. A few ideas:
geojson-to-sqlite ... --properties=properties
geojson-to-sqlite ... --bundle=properties
geojson-to-sqlite ... --json-properties=properties
I think I like the first best, but I'm not entirely convinced by any of them.
from geojson-to-sqlite.
I think --properties
or --properties=properties
is totally reasonable. Maybe doing geojson-to-sqlite ... --properties
defaults to a field called properties
and --properties=props
calls the field props
.
from geojson-to-sqlite.
I don't actually know of a pattern using Click that can understand the difference between --properties
and --properties=properties
- I think because Click treats --properties=x
and --properties x
the same, so options that take values always expect the next token to be a value.
from geojson-to-sqlite.
Looks like this should do it: https://click.palletsprojects.com/en/8.0.x/options/#optional-value
I can try it out tomorrow and send a PR.
from geojson-to-sqlite.
Huh, TIL! Didn't think that was possible.
Looking forward to the PR!
from geojson-to-sqlite.
Two related PRs that might be worth getting merged before this:
- #26 because it's probably the same block of code and will likely cause a conflict with this
- simonw/sqlite-utils#385 consolidates the spatialite operations this library uses into
sqlite-utils.gis
That second one is less critical, if you're prioritizing.
from geojson-to-sqlite.
Tests failed after the merge for some reason, re-opening. https://github.com/simonw/geojson-to-sqlite/runs/5416463816?check_suite_focus=true
Looks to me like it's a floating point comparison problem:
E - {'geometry': '{"type":"Polygon","coordinates":[[[-8.0859375,60.93043220292333],[-16.875,50.28933925329177],[-5.9765625,48.92249926375825],[4.21875,52.26815737376816],[1.0546875,60.06484046010452],[-8.0859375,60.93043220292333]]]}',
E + {'geometry': '{"type":"Polygon","coordinates":[[[-8.0859375,60.93043220292332],[-16.875,50.28933925329177],[-5.9765625,48.92249926375824],[4.21875,52.26815737376816],[1.0546875,60.06484046010452],[-8.0859375,60.93043220292332]]]}',
from geojson-to-sqlite.
I've been looking for an excuse to try https://dirty-equals.helpmanual.io/usage/
from geojson-to-sqlite.
Related Issues (20)
- Add test for mixed types of geometry
- Support newline-delimited GeoJSON HOT 1
- Can you make it javascript version? Many people need it HOT 2
- Option to extract Point geometries into latitude/longitude columns HOT 2
- Getting and error ... sqlite3.OperationalError: near ")" HOT 1
- Create spatial indexes HOT 4
- Migrate to GitHub Actions
- --spatial-index and --nl do not play well together HOT 1
- "id" should come first in the table, not last
- Load multiple files in one call HOT 1
- Features are being excluded/missed after v0.2
- Progress bar
- Handle features with missing geometry
- Use new SpatiaLite helper methods HOT 1
- `--spatialite` fails if features have no properties HOT 6
- geojson-to-sqlite --version flag is missing
- Support id keys on features
- Add "Using this with Datasette" section to README
- Also support KML? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geojson-to-sqlite.