Code Monkey home page Code Monkey logo

map180's Introduction

map180

map180 is a Go (golang) library for drawing SVG maps with markers on EPSG:3857.

  • It handles maps that cross the 180 meridian
  • Allows high zoom level data in a specified region.
  • Land and lake layer queries are cached for speed.

Once you have a database with the map data loaded (see below) drawing a map is as simple as:

wm, err = map180.Init(db, `public.map180_layers`, map180.Region(`newzealand`), 256000000)
b, err := wm.SVG(...)

See the Go docs for further details.

Database

Postgres 9.* with Postgis 2.*

Using the Assembled Data

  • Create the tables (and associated indexed) public.map180_layers and public.map180_labels. See etc/nz_map180_layer.ddl
  • Load the data e.g., for the fits db: psql -h 127.0.0.1 fits postgres -f data/new_zealand_map_layers.ddl

If necessary change the schema, table, and user access as required. They can be specificed in map180.Init()

Assembing Data

The goal is to end up with land and lakes multi polygon on EPSG:3857 entered into public.map180_layers and labels in public.map180_labels. The zoom region should include data for your region of interest at higher zoom levels.

The assembled New Zealand data set (data/new_zealand_map_layers.ddl) was made from shape files that where loaded into the DB and then cut and transformed into public.map180_layers and public.map180_layers.

The files etc/load-nz-shp.sh and etc/nz_map180_layer.ddl document the process of creating public.map180_layers. This was then dumped using:

pg_dump -h 127.0.0.1 --table=public.map180_layers --table=public.map180_labels --data-only -U postgres  fits -f data/new_zealand_map_layers.ddl

The assembled New Zealand data set uses data sourced from:

map180's People

Watchers

James Cloos avatar Howard Wu avatar

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.