-
Notifications
You must be signed in to change notification settings - Fork 0
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
Export to OpenDSS #5
Comments
Compute longitude latitude line length in meters @zoek1 https://crosscompute.com/n/0DeV41fyFPwPjiJ5KKRZJ92y12GALB7K # CrossCompute
longitude_latitude_wkt = 'LINESTRING (-73.935242 40.730610, -71.057083 42.361145)'
# pip install shapely
# pip install utm
# pip install geotable
from shapely import wkt
line_wkt = longitude_latitude_wkt
line_geometry = wkt.loads(line_wkt)
line_geometry
<shapely.geometry.linestring.LineString at 0x7fa29c68ae80>
point_geometry = line_geometry.centroid
point_longitude = point_geometry.x
point_latitude = point_geometry.y
import utm
utm_zone_number, utm_zone_letter = utm.from_latlon(point_latitude, point_longitude)[-2:]
utm_zone_number
18
utm_zone_letter
'T'
from geotable.projections import get_utm_proj4
utm_proj4 = get_utm_proj4(utm_zone_number, utm_zone_letter)
utm_proj4
'+proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'
from geotable.projections import get_transform_shapely_geometry, LONGITUDE_LATITUDE_PROJ4
f = get_transform_shapely_geometry(LONGITUDE_LATITUDE_PROJ4, utm_proj4)
f(line_geometry).wkt
'LINESTRING (589912.1585135038 4509398.080315071, 824714.0257488572 4697409.588074385)'
utm_line_geometry = f(line_geometry)
line_length_in_meters = utm_line_geometry.length
line_length_in_meters
300799.341600242
from geopy.distance import geodesic
geodesic((40.730610, -73.935242), (42.361145, -71.057083)).meters
# UTM is accurate only for local distances
300743.5902721274
print(f'utm_zone_number = {utm_zone_number}')
print(f'utm_zone_letter = {utm_zone_letter}')
print(f'utm_proj4 = {utm_proj4}')
print(f'line_utm_wkt = {utm_line_geometry.wkt}')
print(f'line_length_in_meters = {line_length_in_meters}')
utm_zone_number = 18
utm_zone_letter = T
utm_proj4 = +proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
line_utm_wkt = LINESTRING (589912.1585135038 4509398.080315071, 824714.0257488572 4697409.588074385)
line_length_in_meters = 300799.341600242 |
@zoek1 @poguez Ideally, the new format should be translatable into both OpenDSS and PyPSA. Could we please schedule time to review the proposed database architecture and next steps? |
Sure @invisibleroads, I'll review today and discuss with @poguez the next steps, we'll back to you later. 😉 |
The text was updated successfully, but these errors were encountered: