Skip to content
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

Open
5 tasks done
invisibleroads opened this issue Aug 26, 2019 · 3 comments
Open
5 tasks done

Export to OpenDSS #5

invisibleroads opened this issue Aug 26, 2019 · 3 comments
Assignees

Comments

@invisibleroads
Copy link
Member

invisibleroads commented Aug 26, 2019

  • Run OpenDSS
  • Find sample data that we can import into OpenDSS
  • Identify the simplest analysis we can perform with OpenDSS
  • Identify the minimum data we need to perform for that analysis
  • Map how to convert Asset Tracker data into the minimum data for OpenDSS
@invisibleroads
Copy link
Member Author

invisibleroads commented Nov 8, 2019

Compute longitude latitude line length in meters

@zoek1
https://crosscompute.com/r/dP6dXhdcMOG8pxm5UuBYBenxeikZdhwG

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

@invisibleroads
Copy link
Member Author

@zoek1 @poguez
I drafted the proposed database architecture
https://github.com/AmericanPublicPowerAssociation/asset-tracker-server/tree/develop/experiments/database-20191205-1830

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?

@zoek1
Copy link
Collaborator

zoek1 commented Dec 6, 2019

Sure @invisibleroads, I'll review today and discuss with @poguez the next steps, we'll back to you later. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants