File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
mapswipe_workers/mapswipe_workers/utils Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -116,15 +116,21 @@ def remove_noise_and_add_user_info(json: dict) -> dict:
116116 for i , subset in enumerate (chunk_list ):
117117 changeset_results = query_osm (subset , changeset_results )
118118 logger .info (
119- f"finished query { i } /{ len (chunk_list )} ,{ round (i / len (chunk_list ), 1 )} %"
119+ f"finished query { i } /{ len (chunk_list )} , { 100 * round (i / len (chunk_list ), 2 )} %"
120120 )
121121
122122 for feature in json ["features" ]:
123123 changeset = changeset_results [feature ["properties" ]["changesetId" ]]
124- feature ["properties" ]["username" ] = changeset ["username" ]
125124 feature ["properties" ]["userid" ] = changeset ["userid" ]
126- feature ["properties" ]["comment" ] = changeset ["comment" ]
127- feature ["properties" ]["created_by" ] = changeset ["created_by" ]
125+ for attribute_name in ["username" , "comment" , "created_by" ]:
126+ # we need to replace " as this will cause problems
127+ # when importing to postgres
128+ try :
129+ feature ["properties" ][attribute_name ] = changeset [
130+ attribute_name
131+ ].replace ('"' , "" )
132+ except AttributeError :
133+ pass
128134
129135 logger .info ("finished filtering and adding extra info" )
130136 if any (x > 0 for x in missing_rows .values ()):
You can’t perform that action at this time.
0 commit comments