Comments (3)
It sounds like you're saving your data as GeoJSON, yes? In 2016, a standards committee removed the crs
property from GeoJSON and decided that GeoJSON should only use EPSG:4326 coordinates. Mapshaper lets
you export non-EPSG:4326 data, but as you pointed out, the CRS information does not get saved.
If you want to use mapshaper to import GeoJSON that uses EPSG:3857 coordinates, you can use the -proj
command to tell mapshaper what CRS to use, like this:
mapshaper webmercator_data.geojson -proj init=EPSG:3857 ...
I'm not inclined to add a non-standard CRS property to mapshaper's output, if you really need to include CRS info with the file, then you can export as Shapefile or you can export to mapshaper's "snapshot" format, by saving to a file with the .msx
suffix.
from mapshaper.
I understand, thanks for telling me. EPSG:4326 being the standard projection explains a lot of things.
And yes, I mean a GEOJSON. I was mostly just trying to understand why things are the way they are. Thank you!
P.S.: () -> Comments
As a last thing, is there any way to run this batch of commands on the console version of mapshaper? What I'm trying do achieve here is to get rid of polyline and points layers(since exporting data on overpass-turbo.eu is giving me additional stuff other than polygons). Thank you!
Batch(Edited):
mapshaper -i country.geojson \
-drop(Points layer) \
-drop target=2(Possible polylines layer) \
-filter 'tags.admin_level == 2' name=2 no-replace(filter out country polygon to its own layer) \
-target 1(change active layer to layer to clip) \
-clip 2(clip layer to the country polygon's layer) \
-merge-layers target 1,2 \
-proj webmercator \
-o countryEdited.geojson format=geojson \
-o countryEdited.json format=json \
-o countryEdited.svg format=svg
-- Edit: I found out I can do one of the things I wanted, meaning move the country polygon to its layer. Also, the following command works perfectly on the mapshaper website but when run on the terminal it can't find layer '2'(even though it can on the website) and stops the execution:
-drop -drop target=2 -filter 'tags.admin_level == 2' name=2 no-replace -target 1 -clip 2 -merge-layers target 1,2 -proj webmercator -o countryEdited.geojson format=geojson -o countryEdited.json format=json -o countryEdited.svg format=svg
from mapshaper.
I got it, after tweaking the code to fit my needs:
mapshaper -i countryCode.geojson -filter 'tags.admin_level == 2' name=country no-replace target=__id_1 -clip country target=__id_1 -proj webmercator -o force countryCode.geojson target=__id_1 format=geojson -o force countryCode-init.json target=__id_1 format=json -o force countryCode.svg target=__id_1 format=svg
As an added note, it would be useful to name your layers individually, should your -i file have multiple layers. Something like "name=(name1,name2,name3)" in the case of 3 layers in your file.
from mapshaper.
Related Issues (20)
- light blue paths and performance HOT 3
- Memory usage almost 4x size of input geojson file HOT 4
- Filter lines still create polygons HOT 5
- When hovering mouse over feature and scrolling, fill color freaks out HOT 1
- Point layers and data layers do not show up HOT 2
- Error on simplifying GeoJSON file HOT 11
- Javascript error related to polygon editing causes GUI to crash HOT 1
- There is an issue when you import a shapefile HOT 2
- Clip command removes Features visually but not from exported file. HOT 4
- Sticky hand HOT 1
- snap effects multiples layers HOT 1
- geojson from points HOT 2
- Export failed Export failed for an unknown reason HOT 3
- topojson files in power bi HOT 2
- Problem in drawing polygon and importing snapshot file HOT 4
- Export to Shape File Not working HOT 12
- Bug: can't open snapshot file I created on mapshaper.org HOT 3
- Bug: copy as GeoJSON doesn't copy GeoJSON HOT 1
- filter-slivers remove-empty bug
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 mapshaper.