In [1]:
import sys
from pathlib import Path

import pandas as pd
import geopandas as gpd

DIR = Path('..')
sys.path.append(str(DIR))

import arcgdfconvertor as agc

DATA_DIR = DIR/'data/'

%load_ext autoreload
%autoreload 2

Playground


In [2]:
fc = DATA_DIR/'ArcGIS.gdb/Map/stops'
gdf = agc.fc_to_gdf(str(fc))
gdf


Out[2]:
geometry stop_code stop_id stop_lat stop_lon stop_name
0 POINT (1757291.6532 5919487.4322) 7149 0149 -36.857455 174.76443 83 Symonds St
1 POINT (1757597.0082 5919795.0909) 7148 0160 -36.854632 174.76779 36 Symonds St
2 POINT (1757584.2243 5919779.013) 7150 0161 -36.854779 174.76765 38 Symonds St
3 POINT (1757567.8373 5919761.004) 7152 0162 -36.854944 174.76747 44 Symonds St
4 POINT (1757386.7252 5919564.6951) 7154 0163 -36.856743 174.76548 86 Symonds St
5 POINT (1757092.1874 5919649.0446) 7061 5100 -36.856032 174.76216 385 Queen St
6 POINT (1757093.2703 5919611.0683) 7062 5113 -36.856374 174.76218 490 Queen St
7 POINT (1757140.1997 5919206.2231) 7164 5115 -36.860014 174.76279 Symonds St Overbridge..
8 POINT (1757153.2011 5919234.1728) 7162 5116 -36.859760 174.76293 Symonds St Overbridge
9 POINT (1757169.9018 5919269.2681) 7160 5117 -36.859441 174.76311 Symonds St Overbridge.
10 POINT (1757186.5821 5919303.254) 7158 5118 -36.859132 174.76329 Symonds St Overbridge
11 POINT (1757258.4941 5919430.4444) 7156 5119 -36.857974 174.76407 Symonds St Cemetery
12 POINT (1757421.3431 5919748.7314) 7128 5138 -36.855079 174.76583 84 Wakefield St
13 POINT (1757707.736 5919080.3036) 7227 5428 -36.861054 174.76918 Park Road Opp Auckland Hospital
14 POINT (1757580.8062 5919257.1207) 7284 6450 -36.859482 174.76772 Grafton Rd Opposite Auckland Hospital Gate4
15 POINT (1757571.3304 5919226.9976) 7282 6451 -36.859755 174.76762 Grafton Rd Auckland Hospital Gate4
16 POINT (1757309.3999 5919482.5539) 7159 6970 -36.857496 174.76463 110 Symonds St
17 POINT (1757193.6871 5919398.2355) 1069 7143 -36.858275 174.76335 Karangahape Rd Near Symonds St
18 POINT (1757172.2842 5919398.2977) 1086 7145 -36.858278 174.76311 Karangahape Rd By Cemetery

In [3]:
fc = DATA_DIR/'ArcGIS.gdb/Map/stops_copy01'
agc.gdf_to_fc(gdf, str(fc))


Out[3]:
<Result '..\\data\\ArcGIS.gdb\\Map\\stops_copy01'>

In [4]:
tbl = DATA_DIR/'ArcGIS.gdb/ar_df'
gdf = agc.tbl_to_gdf(str(tbl))
gdf


Out[4]:
stop_id stop_code stop_name stop_lat stop_lon
0 0149 7149 83 Symonds St -36.857455 174.76443
1 0160 7148 36 Symonds St -36.854632 174.76779
2 0161 7150 38 Symonds St -36.854779 174.76765
3 0162 7152 44 Symonds St -36.854944 174.76747
4 0163 7154 86 Symonds St -36.856743 174.76548
5 5100 7061 385 Queen St -36.856032 174.76216
6 5113 7062 490 Queen St -36.856374 174.76218
7 5115 7164 Symonds St Overbridge.. -36.860014 174.76279
8 5116 7162 Symonds St Overbridge -36.859760 174.76293
9 5117 7160 Symonds St Overbridge. -36.859441 174.76311
10 5118 7158 Symonds St Overbridge -36.859132 174.76329
11 5119 7156 Symonds St Cemetery -36.857974 174.76407
12 5138 7128 84 Wakefield St -36.855079 174.76583
13 5428 7227 Park Road Opp Auckland Hospital -36.861054 174.76918
14 6450 7284 Grafton Rd Opposite Auckland Hospital Gate4 -36.859482 174.76772
15 6451 7282 Grafton Rd Auckland Hospital Gate4 -36.859755 174.76762
16 6970 7159 110 Symonds St -36.857496 174.76463
17 7143 1069 Karangahape Rd Near Symonds St -36.858275 174.76335
18 7145 1086 Karangahape Rd By Cemetery -36.858278 174.76311

In [5]:
tbl = DATA_DIR/'ArcGIS.gdb/ar_df_copy'
agc.gdf_to_tbl(gdf, str(tbl))


Out[5]:
'..\\data\\ArcGIS.gdb\\ar_df_copy'