Skip to content
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

開標記錄歷年資料ID應該要加入timestamp資訊 #2

Open
Hoskiss opened this issue Aug 1, 2014 · 3 comments
Open

開標記錄歷年資料ID應該要加入timestamp資訊 #2

Hoskiss opened this issue Aug 1, 2014 · 3 comments

Comments

@Hoskiss
Copy link
Contributor

Hoskiss commented Aug 1, 2014

歷年資料同一批號有很多筆 ID都一樣會造成混淆

@dz1984
Copy link
Contributor

dz1984 commented Aug 1, 2014

原本�產生標售地ID的issue,但產生後的資料,確實會發生ID重覆問題。
img

@dz1984 dz1984 added bug labels Aug 1, 2014
@Hoskiss
Copy link
Contributor Author

Hoskiss commented Aug 7, 2014

現在update的歷年data id中
原本的 民國年份(3碼) => 開標日期年月日(7碼)
這樣應該不會重複了

可是再想一想好像不對噢
這樣沒辦法判斷兩個ID之間是不是同一塊地
不然就是我再另外加一個field是根據地址create UUID出來
如果這樣你們覺得如何呢?

@dz1984
Copy link
Contributor

dz1984 commented Aug 13, 2014

@Hoskiss 同意!我在天龍特公地方法,也是把每筆資料的鄉鎮、路段、段號、地號、分母、分子連成字串後,在做sha1作為該筆的hashid,但國產署爬回來的資料,不像天龍特公地資料那麼乾淨,可能要多做clean的動作。下面是天龍特公地的部份程式碼:

ENCODEPROPERTIES = ['鄉鎮', '路段', '段號', '地號','分母', '分子']

# all propertyies of GeoJSON feature
properties = feature.properties

# append the hashid
encoding_str = (ENCODEPROPERTIES.map (property) ->
  properties[property]).join('')

console.log encoding_str

shasum = crypto.createHash 'sha1'
id = shasum.update(encoding_str, 'utf-8').digest('hex')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants