1.0.1 • Published 6 years ago

osme-geometry v1.0.1

Weekly downloads
11
License
MIT
Repository
-
Last release
6 years ago

Lets draw borders of England using D3, and outline NY meanwhile....

A lot of articles starts from these words. And next always follows

The first task for any map is finding geometry.

And most of normal people could not accomplish this quest. So, then..

OSME-GEOMETRY

The source for shapes for all the countries and states.

NPM

Import

First step is to get data from osme-geometry

UMD

You can use unpkg to get access to the datafile.

normal quality data
<script src="https://unpkg.com/osme-geometry/umd/AU.js"></script>
highter quality data
<script src="https://unpkg.com/osme-geometry/umd/AU.hd.js"></script>
low quality data
<script src="https://unpkg.com/osme-geometry/umd/AU.sd.js"></script>

data without maritime borders (ie with coastline) 
<script src="https://unpkg.com/osme-geometry/umd/AU.coast.js"></script>

data will be stored in
window.osmeGeometry['AU']

NodeJS

  import AUGeometry from 'osme-geometry/AU/geom.js';
// for nodejs you can also specify language  
import AUGeometry from 'osme-geometry/AU/de.geom.js';
import AUGeometry from 'osme-geometry/AU/en.coast.hd.js';

Convert

Data is stored in OSME format, similar, but incompatible to TopoJson. To use data, you first need to convert it into GeoJSON

  osme.geoJson(AUGeometry).then(geoJson => doSomething);

You can found different way to display a data in osme repository. It is also possible to use osme without osme-geometry, in that case data will be fetched from backend provided by esosedi(http), or geolocated(https)

osme.geoJson('AU').then(geoJson => doSomething);

Example

http://data.esosedi.org/ - project home page.

Origin of a data

  • The data included in this document is from www.openstreetmap.org.
  • The data included in this document is from wikipedia.org.
  • The data included in this document is from geonames.org.
  • The data included in this document is from esosedi.org.
  • The data is made available under ODbL and CC-BY-SA

Licence

MIT