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

Oasis - Prepare for charge station input #237

Closed
CodeBear801 opened this issue Mar 20, 2020 · 5 comments
Closed

Oasis - Prepare for charge station input #237

CodeBear801 opened this issue Mar 20, 2020 · 5 comments
Assignees
Labels
NewFeature New feature or feature improvement Prototype Proof of concept

Comments

@CodeBear801
Copy link

CodeBear801 commented Mar 20, 2020

Subtask of #231

Input

For charge station data, or POI data, they usually recorded in database. First step would be dump this database into csv format, each line represent information for a single charge station.

csv
image

Processing flow

Telenav's Database(postGIS) 
       -> csv 
               -> adjust column name 
                       -> convert csv to json 
                                 -> decoding json

More details could go to here: #237 (comment)

Target format

Electricity charge stations, expect input in JSON format follow OSM's tag definition about node and charging_station, example:

{
   "id": 12345,
   "lat": 51.5173639,
   "lon": -0.140043,
   "amenity": "charging_station",
   "operator": "NOFT",
   "fee": "yes",
   "capacity":4,
}
  • Later could implement more input connector: pbf, csv, etc.
  • We want to make this json format as protocol for following processing
  • A sample JSON record could be found here
  • Json record sample:
[{"id":12345,"vendor_code":"NOFT","vendor_poi_id":"NOFT-10_NREL99930@-@NOCO-37145190@-@NOCO-996595530","lat":0.0,"lon":0.0,"nav_lat":0.0,"nav_lon":0.0,"dis_lat":0.0,"dis_lon":0.0,"map_link_id":12345,"side_of_street":"+","country":"USA","space_id":"USA_CA","airport_code":"NULL","is_national":false,"is_state_importance":false,"is_city_importance":false,"fax":"NULL","phone":8054662325,"encoded_phone":"Prefix=1,CountryCode=1,AreaCode=805,LocalNumber=4662325,RawData=8054662325,Preferred=1,E164=+18054662325,PhoneType=phone","email":"NULL","web_url":"NULL","category_id_gather":"xxx``xxx``xxx","chain_gather":"1364@-@@-@",,"hilbert":2.32E+11,"amenity":"charging_station"},]
@CodeBear801
Copy link
Author

CodeBear801 commented Mar 24, 2020

Flow

Telenav's Database(postGIS) -> csv -> adjust column name -> convert csv to json -> decoding json
  • For information about charge station dump, please go to Telenav wiki
  • For sample JSON output, please go to Telenav file repo
  • Adjust column name means convert names used internally to a common OSM name, such as PlaceID -> ID

@wangyoucao577
Copy link

wangyoucao577 commented Mar 26, 2020

Subtask of #231

Input

For charge station data, or POI data, they usually recorded in database. First step would be dump this database into csv format, each line represent information for a single charge station.

csv record sample:

[{"id":12345,"vendor_code":"NOFT","vendor_poi_id":"NOFT-10_NREL99930@-@NOCO-37145190@-@NOCO-996595530","lat":0.0,"lon":0.0,"nav_lat":0.0,"nav_lon":0.0,"dis_lat":0.0,"dis_lon":0.0,"map_link_id":12345,"side_of_street":"+","country":"USA","space_id":"USA_CA","airport_code":"NULL","is_national":false,"is_state_importance":false,"is_city_importance":false,"fax":"NULL","phone":8054662325,"encoded_phone":"Prefix=1,CountryCode=1,AreaCode=805,LocalNumber=4662325,RawData=8054662325,Preferred=1,E164=+18054662325,PhoneType=phone","email":"NULL","web_url":"NULL","category_id_gather":"xxx``xxx``xxx","chain_gather":"1364@-@@-@",,"hilbert":2.32E+11,"amenity":"charging_station"},]

Processing flow

Telenav's Database(postGIS) 
       -> csv 
               -> adjust column name 
                       -> convert csv to json 
                                 -> decoding json

More details could go to here: #237 (comment)

Target format

Electricity charge stations, expect input in JSON format follow OSM's tag definition about node and charging_station, example:

{
   "id": 12345,
   "lat": 51.5173639,
   "lon": -0.140043,
   "amenity": "charging_station",
   "operator": "NOFT",
   "fee": "yes",
   "capacity":4,
}
  • Later could implement more input connector: pbf, csv, etc.
  • We want to make this json format as protocol for following processing
  • A sample JSON record could be found here

The original format is not csv. It's json actually (it's a json array with head [ and tail ]). It should be able to parse by json library directly. The sample json you metiond is a json with line endings for better human readable, some json libraries support it. But without line endings is more common json.

@CodeBear801 CodeBear801 added the NewFeature New feature or feature improvement label Mar 26, 2020
@CodeBear801
Copy link
Author

Subtask of #231

Input

For charge station data, or POI data, they usually recorded in database. First step would be dump this database into csv format, each line represent information for a single charge station.
csv record sample:

[{"id":12345,"vendor_code":"NOFT","vendor_poi_id":"NOFT-10_NREL99930@-@NOCO-37145190@-@NOCO-996595530","lat":0.0,"lon":0.0,"nav_lat":0.0,"nav_lon":0.0,"dis_lat":0.0,"dis_lon":0.0,"map_link_id":12345,"side_of_street":"+","country":"USA","space_id":"USA_CA","airport_code":"NULL","is_national":false,"is_state_importance":false,"is_city_importance":false,"fax":"NULL","phone":8054662325,"encoded_phone":"Prefix=1,CountryCode=1,AreaCode=805,LocalNumber=4662325,RawData=8054662325,Preferred=1,E164=+18054662325,PhoneType=phone","email":"NULL","web_url":"NULL","category_id_gather":"xxx``xxx``xxx","chain_gather":"1364@-@@-@",,"hilbert":2.32E+11,"amenity":"charging_station"},]

Processing flow

Telenav's Database(postGIS) 
       -> csv 
               -> adjust column name 
                       -> convert csv to json 
                                 -> decoding json

More details could go to here: #237 (comment)

Target format

Electricity charge stations, expect input in JSON format follow OSM's tag definition about node and charging_station, example:

{
   "id": 12345,
   "lat": 51.5173639,
   "lon": -0.140043,
   "amenity": "charging_station",
   "operator": "NOFT",
   "fee": "yes",
   "capacity":4,
}
  • Later could implement more input connector: pbf, csv, etc.
  • We want to make this json format as protocol for following processing
  • A sample JSON record could be found here

The original format is not csv. It's json actually (it's a json array with head [ and tail ]). It should be able to parse by json library directly. The sample json you metiond is a json with line endings for better human readable, some json libraries support it. But without line endings is more common json.

My bad, I put a converted json record there :(
Update the first comment.

@CodeBear801
Copy link
Author

It is also possible to directly dump sql query result to json format.

@wangyoucao577
Copy link

Aha! Now it makes sense. But I still think the csv-to-json is not a good name since the convertion is not generic but for specified domain. How about rename it to something like poi-preprocess or poi-unify? Or maybe poi-converter that possible to support converting between csv,json,pbf, etc.

CodeBear801 added a commit that referenced this issue Mar 31, 2020
* feat: implement tools to convert from csv to json
issue: #237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NewFeature New feature or feature improvement Prototype Proof of concept
Projects
None yet
Development

No branches or pull requests

2 participants