-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.8.1 林班地資料 endpoint #45
Comments
This imports geojson to mongodb:
|
前端會使用的狀況請見 WF 2.8 /forest-compartment-boundary/overall 請只做 POST /forest-compartment-boundary 就好,如果沒有送出 query 座標就報錯 這裡預期前端是就地圖的中心位置來抓取林班地 polygon 來套疊 |
@cjk-halodule |
POST /forest-compartment-boundary @cjk-halodule
|
|
目前 API 用法就是送經緯度即可。 POST /forest-compartment-boundary{
"decimalLatitude": "24.564853",
"decimalLongitude": "120.991452"
} 有 match 到就會回 MultiPolygon 的坐標,沒有就是空的 |
@rwu823 |
不過目前應該會超大超慢。請確認有 geoJSON 丟出來就好。我還得轉 TopoJSON 才能供 Leaflet 套疊。 |
對於 response 的結構有點不太懂,
|
表示多邊形的關係。請先別處理呈現,我還在試 topojson. Sent with GitHawk |
有考慮 center 變動範圍在某個幅度下就不要重送 api 嗎? |
同意,請你設定一個合理的範圍,例如在目前的 zoom level 原中心移到 x 軸或 y軸的 1/3 以上? |
這兩天的研究下來,瞭解到將個別的 feature 轉成 topojson 對於體積並沒有多大幫助;純粹就體積來說,features 整個一起轉才能看到顯著差別。經過幾個程序得到目前已匯入 db 的 geojson:
如此將原本 176M 的 geojson 縮到 20M, 3699 個 features 平均每個約 5.4K. |
|
我是這樣想,後端只做 point-in-polygon 的計算,丟出目前中心點所在林班地的 geojson 多邊形供套疊。 這個功能沒給使用者測試過,有回應了再看看是否細部調整。如何? |
|
|
已補上 zoom level & 經緯度移動範圍判斷 |
@kelp404 我把林班地資料直接複製到目前的資料庫中? |
目前這個 endpoint 由 @moogoo78 接手,做法是:
|
得到
另外也缺文件喔。 |
Verified. Document to clarify usage: http://bit.ly/2VKfuhb. |
與 TaiBIF/camera-trap-webapp#18 相關
需要送出林班地 JSON 供前端套疊
Expected POST application/json object:
Expected response application/json
When no intersect:
As this is an independent service endpoint, two files are expected in /common/models/
Model name would be: ForestCompartmentBoundary
參考
不過應該是不會需要 loopback 特別的支援,這裡是需要 point-in-polygon 的 mongo query 再把 GeoJSON object 送出來即可。
The text was updated successfully, but these errors were encountered: