> For the complete documentation index, see [llms.txt](https://sigma-1.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sigma-1.gitbook.io/notes/webdev/gis.md).

# GIS

### API

* [Map Tools: List of Google maps tools](http://www.mapdevelopers.com/map_tools.php)
* [GeoPy](https://pypi.python.org/pypi/geopy)

### Distance

* [Calculate Distance Using Javascript and Google Maps To Create A RealTime Quote Based On Distance](http://www.enlightenmental.com/news-blog/calculate-distance-using-javascript-and-google-maps-to-create-a-realtime-quote-based-on-distance/)
* [distancebetweencities](http://www.distancebetweencities.net/route-planner)
* [Distance between cities calculator](http://www.distance-cities.com/)
* [The Zip Code Database Project](http://zips.sourceforge.net/) (\*)
* [Computing the distance between two locations on Earth from coordinates](http://www.johndcook.com/blog/python_longitude_latitude/)

### ZIP code

* [Zip Code Distance, Radius and Location API](https://www.zipcodeapi.com/) »»»重要!
* [ZIP Code Distance Database -- ZIP Code Tabulation Area (ZCTA) Distance Database](http://www.nber.org/data/zip-code-distance-database.html)
* [Nation's most stressful ZIP Codes: California city makes top 10](http://www.latimes.com/local/lanow/la-me-ln-stressful-zip-codes-20141124-story.html) (有趣!)
* [ZIP Codes 101](https://smartystreets.com/articles/zip-codes-101)
*

## 圖資

* [Populated Places](http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-populated-places/)

## How to check if a point is inside a rectangle?

* [zip code](http://www.unitedstateszipcodes.org/ca/#zips)
* [How to check if a point is inside a rectangle - Python](http://martin-thoma.com/how-to-check-if-a-point-is-inside-a-rectangle/)
* [\*Finding whether a point lies inside a rectangle or not](http://stackoverflow.com/questions/2752725/finding-whether-a-point-lies-inside-a-rectangle-or-not)
* [How to determine if a point is inside a rectangle?](http://articles.leetcode.com/2010/04/how-to-determine-if-point-is-inside.html)
* [怎样判断一个点是否在另四个点组成的矩形里？矩形是可以倾斜的](http://bbs.csdn.net/topics/10296194)
* [请问如何判断一点是否在矩形内](http://bbs.csdn.net/topics/60065160)
* [判断点在直线的一侧？判断点在矩形、三角形、多边形内？](http://www.cnblogs.com/xfzhang/archive/2012/04/14/2447820.html)
* [判断点与多边形的位置关系](http://zheng12tian.iteye.com/blog/1922112)
* [判断点是否在矩形内!已知矩形的长宽和一顶点坐标,如何判断一点是否在矩形内?](http://zuoye.baidu.com/question/748f33710e594c53bc20a568fa215ffc.html)
* [一种判断点与多边形关系的快速算法](http://wenku.baidu.com/view/5e3913a2b0717fd5360cdccf.html?qq-pf-to=pcqq.c2c)
* [（判断点在多边形内）-引射线判断法](http://www.360doc.com/content/11/0411/14/6605519_108820541.shtml)
* [How to check if a point is inside a rectangle?](http://math.stackexchange.com/questions/190111/how-to-check-if-a-point-is-inside-a-rectangle)
* [计算几何算法概览](http://dev.gameres.com/Program/Abstract/Geometry.htm#%E5%88%A4%E6%96%AD%E7%82%B9%E6%98%AF%E5%90%A6%E5%9C%A8%E5%A4%9A%E8%BE%B9%E5%BD%A2%E4%B8%AD)
* [pygame](https://www.pygame.org/docs/ref/rect.html#pygame.Rect.collidepoint)

## 慣停

短距離(同一州內？)：用DP的概念，把城市A-城市B中間的所有城市用矩形框出來，存到DB，這樣以後可以直接取用。

但是對於長距離來說，路徑可能會轉折，可從：

* User Data逐漸學習
* 跨州的長距離可切成隔壁相鄰州的許多小段(城市A-城市z + 城市z-城市B)，再集合這些小段間的城市
* 從Google MAP取的Routing，從這裡面挑出經停點，再集合這些小段的城市
* 我們自己建一個主要城市網路表，再用這些主要城市間的連線分小段查表
* 建立車源時(or車找貨時)，先秀出一個系統建議的路線，再讓操作人員微調，系統之後對於相似路線就有經驗值了

#### Google Map API

* [RouteBoxer](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/routeboxer/docs/examples.html)
  * [Example](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/routeboxer/examples/routeboxer-v3.html)
* [Get stopover towns using the Google Maps API (directions)](http://stackoverflow.com/questions/14641899/get-stopover-towns-using-the-google-maps-api-directions)
* [Google Maps: how to get country, state/province/region, city given a lat/long value?](http://stackoverflow.com/questions/4013606/google-maps-how-to-get-country-state-province-region-city-given-a-lat-long-va)
* [Get the city names the google map route going through](http://stackoverflow.com/questions/14300217/get-the-city-names-the-google-map-route-going-through)
* [The Google Directions API](https://developers.google.com/maps/documentation/directions/)

#### 路徑最佳化

* [How to use Julia + Google Maps + Forio Epicenter to find your best route through a city](http://forio.com/about/blog/route-optimizer-julia-google-maps-epicenter/)
  * [Demo](https://forio.com/app/showcase/route-optimizer/)
