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

Update PY_LOAD_GEOFILES.sql with possibility of geopackage #31

Open
wants to merge 2 commits into
base: geospatial
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions samples/geospatial/Python UDFs/PY_LOAD_GEOFILES.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ to_geography(wkb, True) as geometry,
properties:Name::string as Name,
properties:altitudeMode::string as altitudeMode
from table(PY_LOAD_GEOFILE(build_scoped_file_url(@tmobile, 'archive_name.zip'), 'file_name.kml'));

-- === Example execution (OGC GeoPackage) ===
-- Note: A specific layer in the .gpkg file is opened by specifying layer name in UDTF `with zip.open(filename,layer=layername) as collection:`
SELECT
properties:Field_1::string as field_1,
properties:Field_2::string as Field_2,
to_geography(wkb, True) as geometry
FROM table(PY_LOAD_GEOFILE(build_scoped_file_url(@stage_name, 'archive_name.zip'), 'file_name.gpkg'));