Coder Social home page Coder Social logo

maptiles.jl's Introduction

MapTiles

CI Coverage Status codecov.io

Installation

MapTiles.jl is not currently a Julia registered package.

Currently only developer version is available. It can be installed using:

$ julia
julia> ]
(@v1.5) pkg> dev https://github.com/yeesian/MapTiles.jl

Display map

Display map from buildin mapsource providers

using MapTiles
using Plots
provider = MapTiles.OpenStreetMapProvider()
minlon, minlat, maxlon, maxlat = -0.4, 46.2, 1.0, 46.9
minlon, minlat, maxlon, maxlat = -11.250, 40.984, 16.853, 52.483
basemap  = MapTiles.fetchmap(minlon, minlat, maxlon, maxlat, provider=provider)
plot(basemap)

It's possible to list all existing map providers using subtypes(MapTiles.AbstractProvider).

To get information about a specific map provider, you can use docstrings help using ?. It should show possible variants, terms of services...

julia> ?
help?> MapTiles.OpenStreetMapProvider

Display map from custom mapsource providers

A custom map source provider need to inherit abstract type AbstractProvider and implements geturl function for this custom map source.

Then, such a custom map provider can be used using:

using MapTiles
using MapTiles: AbstractProvider
import MapTiles: geturl
using Parameters
using Plots

Parameters.@with_kw struct CustomMapProvider <: AbstractProvider
    maxtiles::Int = typemax(Int)
end

function geturl(provider::CustomMapProvider, x::Integer, y::Integer, z::Integer)
    "https://domain.com/$z/$y/$x.png"
end

provider = CustomMapProvider()
minlon, minlat, maxlon, maxlat = -0.4, 46.2, 1.0, 46.9
basemap  = MapTiles.fetchmap(minlon, minlat, maxlon, maxlat, provider=provider)
plot(basemap)

Packages in other Languages

If you're coming from Python or R, you might be interested in the following packages instead:

maptiles.jl's People

Contributors

yeesian avatar rafaqz avatar visr avatar scls19fr avatar

Watchers

 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.