This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
import pandas as pd | |
def arcgis_table_to_df(in_fc, input_fields=None, query=""): | |
"""Function will convert an arcgis table into a pandas dataframe with an object ID index, and the selected | |
input fields using an arcpy.da.SearchCursor. | |
:param - in_fc - input feature class or table to convert | |
:param - input_fields - fields to input to a da search cursor for retrieval | |
:param - query - sql query to grab appropriate values | |
:returns - pandas.DataFrame""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import arcpy | |
def validate_df_names(dataframe,output_feature_class_workspace): | |
"""Returns pandas dataframe with all col names renamed to be valid arcgis table names.""" | |
new_name_list=[] | |
old_names=dataframe.columns.names | |
for name in old_names: | |
new_name=arcpy.ValidateFieldName(name,output_feature_class_workspace) | |
new_name_list.append(new_name) | |
rename_dict={i:j for i,j in zip(old_names,new_name_list)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def write_geojson_to_records(geojson): | |
"""Will write geojson to a list of dictionaries with geometry keys holding coordinates and storing the properties | |
to dictionaries. | |
@param: geojson- geojson file to write to records.""" | |
gjson_data = json.load(geojson, encoding='utf-8') | |
records = [] | |
arcpy.AddMessage("Geojson being read by row...") | |
for feature in gjson_data["features"]: | |
try: | |
row = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
def request_mapillary_image_locations(bbox_list, client_id, max_request_count=10000000, | |
root="https://a.mapillary.com/v3/"): | |
"""Function will make a request for images locations using the Mapillary V3 API within a bbox. It returns a | |
list of geojson loads for use.""" | |
return_lists = [] | |
arc_print("Requesting first geojson payload from Mapillary using bbox: {0}...".format(str(bbox_list))) | |
bbox_string = str(bbox_list[0]) + str(",") + str(bbox_list[1]) + str(",") + str(bbox_list[2]) + str(",") + str( |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIT License | |
Copyright (c) 2017 David Wasserman | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer