Git Product home page Git Product logo

gb-geojson's Introduction

View, create, edit, transform GeoJSON map data in British National Grid reference system.

GeoJSON is a simple data structure based on JavaScript Object Notation (JSON) that can be used to describe geographic features. With gb-geojson you can upload existing GeoJSON, create new features or edit existing objects in either WGS84 Longitude and Latitude or British National Grid Eastings and Northings.

Editing a GeoJSON Feature and reprojecting coordinates to OSGB36

gb-geojson is a tool that allows you to view, create and edit GeoJSON in both ESPG:4326 aka WGS84 and OS National Grid coordinate reference systems. We reproject between these reference systems on the fly so you can edit in either system and interchange as easily as possible, this is done with accuracy that is acceptable for most editing.

Features

  • View, create, edit GeoJSON in WGS84 and OS National Grid coordinate reference systems
  • Reproject on the fly
  • Uses Ordnance Survey backdrop mapping
  • Open from and save to local files

What is the difference between Lon, Lat and OS National Grid?

The "Lon, Lat" and "OS National Grid" switch in gb-geojson toggles the editable GeoJSON display between two different coordinate reference systems; ESPG:4326 and ESPG:27700. This changes the appearance of the cartesian coordinate data to and from the recognisable Longitude, Latitude coordinates and Ordnance Survey Eastings, Northings used by maps in Great Britain. The default reference system used by GeoJSON to describe its geospatial data is ESPG:4326 however the purpose of gb-geojson is to facilitate editing of GeoJSON in ESPG:27700 so by toggling this switch we reproject between these reference systems.

The GeoJSON geospatial data is always projected on the map using the Spherical Mercator ESPG:3857. The map tile layer is projected using ESPG:27700 from the OS OpenSpace service.

Note that the GeoJSON spec states that coordinates should be in the form X, Y for whichever projected reference system used.

The GeoJSON spec lists the CRS property but this is ignored by gb-geojson at present due to format ambiguity and to maintain tool simplicity.

The reprojection is done by the gbify-geojson library using Proj4js.

Example data

Checkout the data/ directory for some example GeoJSONs (sic).

{"type":"Feature","properties":{"popupContent":"I am SU43."},"geometry":{"type":"Polygon","coordinates":[[[440000,130000],[450000,130000],[450000,140000],[440000,140000],[440000,130000]]]}}

Development

Local development

Use webpack to build and run local webserver.

$ npm run webpack-server

Production build

To produce a minified release Production bundle:

$ npm run build

Contributions

Please use the GitHub pull-request mechanism to submit contributions.

Credits

This stands on the shoulders by reusing many excellent libraries and is inspired by the great geojson.io.

Some of the other libraries used are:

Alternatives

If you dont want to use this tool then a simple alternative is to locally reproject your GeoJSON dataset with something such as GDAL or reproject js library and then import into geojson.io.

GDAL can do this also with something like this to reproject OSGB36 > WGS84, then upload the resultant GeoJSON somewhere.

$ ogr2ogr -s_srs EPSG:27700 -f "GeoJSON" output.json input.json -t_srs EPSG:4326

License

This project is available for use under the MIT software license. See LICENSE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.