Files
PVPlant/Export/exportGeoJson.py
2025-01-28 00:04:13 +01:00

15 lines
364 B
Python

import geojson
from geojson import Point, Feature, FeatureCollection, dump
point = Point((-115.81, 37.24))
features = []
features.append(Feature(geometry=point, properties={"country": "Spain"}))
# add more features...
# features.append(...)
feature_collection = FeatureCollection(features)
with open('myfile.geojson', 'w') as f:
dump(feature_collection, f)