-
Notifications
You must be signed in to change notification settings - Fork 32
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
Direct WKB <-> WKT conversion functions? #60
Comments
It would greatly improve functionality for those who do not need GeoJSON, it saves a step. |
@tomplex I think this is worthwhile to add. Do you have some ideas about the interface? Were you thinking a basic module/function interface (as an extension to the existing library functions), or a more OO-type interface? I could see benefits of both. I can take a stab at that, but I'm of course open to other ideas. Here are some initial thoughts: from geomet import wkt
wkt.to_wkb('POINT(1 2)', big_endian=False) # similar interface to geomet.wkb.dumps from geomet import wkt
x = wkt.WKT('POINT(1 2)')
x.wkb.dumps()
with open('my.file', 'w') as fp:
x.geopackage.dump(fp)
# This implies the creation of some new classes, including geomet.wkt.WKT, geomet.wkb.WKB, geomet.geopackage.GeoPackage, etc.
# Each one will have a property which returns an object of each other type. Do any of these approaches appeal to you? |
What do you think about adding a package with some small wrapper functions which convert directly from WKB <-> WKT (and perhaps GPKG)? They're easy enough for any user to implement, but it might be nice to include them as shortcuts in the package.
The text was updated successfully, but these errors were encountered: