Skip to main content

Python library for Geo & WebGIS.

Project description

geocraft

Note: geocraft is still under development and backward compatibility is not guaranteed before reaching v1.0.0.

Requirements

python >= 3.9

Installation

pip install geocraft

Use as Library

CoordConverter

CoordConverter is used for convert a coordinate pair (lng, lat) between different coordinate systems.

from geocraft import CoordConverter

converter = CoordConverter(src="bd09", target="gcj02")
print(converter.convert(116.404, 39.915))
Output
(116.39762729119315, 39.90865673957631)

Supported conversions:

  • Conversions between different coordinate systems (Non-Mercator):

    • wgs84 <-> gcj02
    • gcj02 <-> bd09
    • bd09 <-> wgs84
  • Conversions between same coordinate systems (Non-Mercator <-> Mercator):

    • wgs84 <-> wgs84mc
    • gcj02 <-> gcj02mc
    • bd09 <-> bd09mc

BaidumapParser (unstable)

from geocraft.unstable import BaidumapParser

parser = BaidumapParser()
print(parser.parse("06d2dffda107b0ef89f15db6"))
Output
[[116.38542843398525, 39.92151738991259], [116.38538685420565, 39.921513413054086], [116.38535487041676, 39.921506231072506], [116.38532848458672, 39.92149504619131], [116.38531569206987, 39.92148545371144], [116.38529330564644, 39.921465467023225], [116.3852845141087, 39.92143587320667], [116.3852861248264, 39.921355875809574], [116.38533422771435, 39.92047908730609], [116.38539353675836, 39.91952229589755], [116.3854064330775, 39.91880711952102], [116.38559245036473, 39.915271167217114], [116.38569988139689, 39.91329039114644], [116.38575119506572, 39.91231760344198], [116.3858152735157, 39.91155280033522], [116.38581767546371, 39.91153119993237], [116.38582887234888, 39.91151759451542], [116.38584806465622, 39.91151118455345], [116.38612714036417, 39.91152283675588], [116.38798281750744, 39.91163011768973], [116.3899631584974, 39.91170536994815], [116.3899748558365, 39.91170576536653], [116.38998635357804, 39.91170366097775], [116.3899971518169, 39.911699156972], [116.39000675063429, 39.911692453532325], [116.39001475007545, 39.91168385080151], [116.39002065019064, 39.91167374895317], [116.39002425095272, 39.9116626480428], [116.39018690094603, 39.90961567506205], [116.39021979246891, 39.90890369357733], [116.39022369437045, 39.90888399295733], [116.39022869487034, 39.908872791552476], [116.39023579476736, 39.90886278930384], [116.39024469408552, 39.90885428631203], [116.39025519281391, 39.9088476826379], [116.39026659105923, 39.90884327853313], [116.39027878884309, 39.90884107403712], [116.39029108626922, 39.90884136940016], [116.39116042465139, 39.90886575611594], [116.3922820783269, 39.90888539623907], [116.39230067572389, 39.90889119045109], [116.39231287300878, 39.908902386329196], [116.39232226990865, 39.90891838282385], [116.39232626731287, 39.90893448091355], [116.39216949439682, 39.91173680083455], [116.39217469116724, 39.911756098375875], [116.39218468818736, 39.91177009470021], [116.39219908549137, 39.911778889931476], [116.3922153829792, 39.91178508471429], [116.39249665538212, 39.911795400779155], [116.39457608742869, 39.91184828449316], [116.39546722959567, 39.911871721001525], [116.39617829201882, 39.91190361582307], [116.39620469380358, 39.91191241199949], [116.39621989333169, 39.91192840928326], [116.39622788959593, 39.91196200663886], [116.39618938023432, 39.9127171750007], [116.39615888597162, 39.91336834744963], [116.3961363961661, 39.91399232022329], [116.39608184298437, 39.915040276874095], [116.39604492664373, 39.91583704344106], [116.39597912889114, 39.91718418766118], [116.39589089408508, 39.918769724073975], [116.39584597617417, 39.919563292602085], [116.39579622270976, 39.920600050383584], [116.39577532529212, 39.921264021793554], [116.39575766134108, 39.9216968038172], [116.39575924431932, 39.92181599788087], [116.39575763932943, 39.9218495965228], [116.39574483479748, 39.92187279738877], [116.39572323096533, 39.92188560012459], [116.39434796509437, 39.92182585974528], [116.39345917536005, 39.92179967153906], [116.39244243997949, 39.92176895519337], [116.39072107959862, 39.92170693209769], [116.38992124657688, 39.92167523964209], [116.38853761585227, 39.92163742692192], [116.38741639483735, 39.92158835352149], [116.3864247869287, 39.921548854581346], [116.3856347368753, 39.92152447644972], [116.38542843398525, 39.92151738991259]]

Use as Command-Line Tools

For commands below, use --help to check all available options.

geocraft-coord-convert

$ geocraft-coord-convert -i "bd09" -o "gcj02" -c "116.404, 39.915"
Output
(116.39762729119315, 39.90865673957631)

geocraft-baidumap-parse (unstable)

$ geocraft-baidumap-parse -i "06d2dffda107b0ef89f15db6"
Output
[[116.38542843398525, 39.92151738991259], [116.38538685420565, 39.921513413054086], [116.38535487041676, 39.921506231072506], [116.38532848458672, 39.92149504619131], [116.38531569206987, 39.92148545371144], [116.38529330564644, 39.921465467023225], [116.3852845141087, 39.92143587320667], [116.3852861248264, 39.921355875809574], [116.38533422771435, 39.92047908730609], [116.38539353675836, 39.91952229589755], [116.3854064330775, 39.91880711952102], [116.38559245036473, 39.915271167217114], [116.38569988139689, 39.91329039114644], [116.38575119506572, 39.91231760344198], [116.3858152735157, 39.91155280033522], [116.38581767546371, 39.91153119993237], [116.38582887234888, 39.91151759451542], [116.38584806465622, 39.91151118455345], [116.38612714036417, 39.91152283675588], [116.38798281750744, 39.91163011768973], [116.3899631584974, 39.91170536994815], [116.3899748558365, 39.91170576536653], [116.38998635357804, 39.91170366097775], [116.3899971518169, 39.911699156972], [116.39000675063429, 39.911692453532325], [116.39001475007545, 39.91168385080151], [116.39002065019064, 39.91167374895317], [116.39002425095272, 39.9116626480428], [116.39018690094603, 39.90961567506205], [116.39021979246891, 39.90890369357733], [116.39022369437045, 39.90888399295733], [116.39022869487034, 39.908872791552476], [116.39023579476736, 39.90886278930384], [116.39024469408552, 39.90885428631203], [116.39025519281391, 39.9088476826379], [116.39026659105923, 39.90884327853313], [116.39027878884309, 39.90884107403712], [116.39029108626922, 39.90884136940016], [116.39116042465139, 39.90886575611594], [116.3922820783269, 39.90888539623907], [116.39230067572389, 39.90889119045109], [116.39231287300878, 39.908902386329196], [116.39232226990865, 39.90891838282385], [116.39232626731287, 39.90893448091355], [116.39216949439682, 39.91173680083455], [116.39217469116724, 39.911756098375875], [116.39218468818736, 39.91177009470021], [116.39219908549137, 39.911778889931476], [116.3922153829792, 39.91178508471429], [116.39249665538212, 39.911795400779155], [116.39457608742869, 39.91184828449316], [116.39546722959567, 39.911871721001525], [116.39617829201882, 39.91190361582307], [116.39620469380358, 39.91191241199949], [116.39621989333169, 39.91192840928326], [116.39622788959593, 39.91196200663886], [116.39618938023432, 39.9127171750007], [116.39615888597162, 39.91336834744963], [116.3961363961661, 39.91399232022329], [116.39608184298437, 39.915040276874095], [116.39604492664373, 39.91583704344106], [116.39597912889114, 39.91718418766118], [116.39589089408508, 39.918769724073975], [116.39584597617417, 39.919563292602085], [116.39579622270976, 39.920600050383584], [116.39577532529212, 39.921264021793554], [116.39575766134108, 39.9216968038172], [116.39575924431932, 39.92181599788087], [116.39575763932943, 39.9218495965228], [116.39574483479748, 39.92187279738877], [116.39572323096533, 39.92188560012459], [116.39434796509437, 39.92182585974528], [116.39345917536005, 39.92179967153906], [116.39244243997949, 39.92176895519337], [116.39072107959862, 39.92170693209769], [116.38992124657688, 39.92167523964209], [116.38853761585227, 39.92163742692192], [116.38741639483735, 39.92158835352149], [116.3864247869287, 39.921548854581346], [116.3856347368753, 39.92152447644972], [116.38542843398525, 39.92151738991259]]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geocraft-0.3.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geocraft-0.3.4-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file geocraft-0.3.4.tar.gz.

File metadata

  • Download URL: geocraft-0.3.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1025-azure

File hashes

Hashes for geocraft-0.3.4.tar.gz
Algorithm Hash digest
SHA256 088c8e6161d0abed8b6314328822489bb1b5a313b1542fee3463f15ed88bbee2
MD5 8b062727465e4a909bd2b00d1cd25008
BLAKE2b-256 2b1e1cd41c03a004e55397d828a8a20a49437105e8e1b6bbdd50d94e06075d2f

See more details on using hashes here.

File details

Details for the file geocraft-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: geocraft-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1025-azure

File hashes

Hashes for geocraft-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6aa9df58eb340be51768b4b4d54ef472042db67dfa538065835dc2367610b96b
MD5 65e61201513cb1b9b0eb836a1d505882
BLAKE2b-256 1b0e7d78e2869ef2c99d2b5a85fa034140c95bdfccee38371fa7b2d00c3e7abe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page