ccfx 0.7.0__py3-none-any.whl → 0.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ccfx/ccfx.py CHANGED
@@ -490,6 +490,26 @@ def readFrom(filename, decode_codec = None, v=False):
490
490
  g.close
491
491
  return file_text
492
492
 
493
+
494
+ def pointsToGeodataframe(point_pairs_list, columns = ['latitude', 'longitude'], auth = "EPSG", code = '4326', out_shape = '', format = 'gpkg', v = False, get_geometry_only = False):
495
+ df = pandas.DataFrame(point_pairs_list, columns = columns)
496
+ geometry = [Point(xy) for xy in zip(df['latitude'], df['longitude'])]
497
+
498
+ if get_geometry_only:
499
+ return geometry[0]
500
+
501
+ gdf = geopandas.GeoDataFrame(point_pairs_list, columns = columns, geometry=geometry)
502
+ drivers = {'gpkg': 'GPKG', 'shp': 'ESRI Shapefile'}
503
+
504
+ gdf = gdf.set_crs(f'{auth}:{code}')
505
+
506
+ if out_shape != '':
507
+ if v: print(f'creating shapefile {out_shape}')
508
+ gdf.to_file(out_shape, driver=drivers[format])
509
+
510
+ return gdf
511
+
512
+
493
513
  def readFile(filename, decode_codec = None, v=False):
494
514
  return readFrom(filename, decode_codec, v)
495
515
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ccfx
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: This package simplifies regular common actions for quick prototyping in a user friendly way
5
5
  Author-email: Celray James CHAWANDA <celray@chawanda.com>
6
6
  License: MIT
@@ -1,11 +1,11 @@
1
1
  ccfx/__init__.py,sha256=VmBeF3oj6JTJ_793d4i8PvhyF8_FxaxA1L_FmHWqitc,142
2
- ccfx/ccfx.py,sha256=4BD22BQovfkcAFZRkoHaA1quvXlDBFc1GiH_Fffz6Q8,55571
2
+ ccfx/ccfx.py,sha256=L0BeQLs4H9o8MlKlmr7pHqFmjbd5A3yDBKsk3XSzU5s,56313
3
3
  ccfx/excel.py,sha256=cQ4TQW49XqbMB3sSS0IOhO3-WArIolEBIrvOvhFyPtI,4757
4
4
  ccfx/mssqlConnection.py,sha256=TwyZXhHHI7zy6BSfH1pszuHVJ5cmndRC5dVxvEtSTks,7904
5
5
  ccfx/sqliteConnection.py,sha256=jEJ94D5ySt84N7AeDpa27Rclt1NaKhkX6nYzidwApIg,11104
6
6
  ccfx/word.py,sha256=AGa64jX5Zl5qotZh5L0QmrsjTnktIBhmj_ByRKZ88vw,3061
7
- ccfx-0.7.0.dist-info/licenses/LICENSE,sha256=2-M3fBUS3FmrSIrqd3cZDmxXxojWVJtZY-SHSRE6RxM,1098
8
- ccfx-0.7.0.dist-info/METADATA,sha256=_rPWPy0bHKGdUv5y2Ovt_XGpIbRv7Xa33oJJDfWDv-o,5425
9
- ccfx-0.7.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
10
- ccfx-0.7.0.dist-info/top_level.txt,sha256=_cSvSA1WX2K8TgoV3iBJUdUZZqMKJbOPLNnKLYSLHaw,5
11
- ccfx-0.7.0.dist-info/RECORD,,
7
+ ccfx-0.8.0.dist-info/licenses/LICENSE,sha256=2-M3fBUS3FmrSIrqd3cZDmxXxojWVJtZY-SHSRE6RxM,1098
8
+ ccfx-0.8.0.dist-info/METADATA,sha256=1BskaEpbKDSaouiPDW9xdIlLdb62qPwwFjH2mUi9mpQ,5425
9
+ ccfx-0.8.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
10
+ ccfx-0.8.0.dist-info/top_level.txt,sha256=_cSvSA1WX2K8TgoV3iBJUdUZZqMKJbOPLNnKLYSLHaw,5
11
+ ccfx-0.8.0.dist-info/RECORD,,
File without changes