Skip to content

Instantly share code, notes, and snippets.

Ryan Cooper maptastik

Block or report user

Report or block maptastik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maptastik
maptastik / LineIntersectionsGeopandas.ipynb
Created Apr 4, 2019
Using geopandas to find line intersection points within a dataset
View LineIntersectionsGeopandas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maptastik
maptastik / MultipleGeometryGDF.ipynb
Created Apr 3, 2019
Creating and working with multiple geometry columns in a single GeoDataFrame
View MultipleGeometryGDF.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View intersectingPolygonAttributes.arcade
var polygon = FeatureSetByName($map, 'Polygon Layer Name', ['Field1', 'Field2', 'Field3'])
var polygonUnderFeatureInfo = Intersects(polyogn, $feature) //
return First(Intersects(parcels, $feature))
View create_facilityid_values.py
# max = max FACILITYID value in dataset. This can be calculated with a function
with arcpy.da.UpdateCursor('feature_class', ['FACILITYID'], "FACILITYID IS NULL") as cursor:
for row in cursor:
new_facilityid_number = max + 1
row[0] = str(new_facilityid_number)
max = new_facilityid_number
cursor.updateRow(row)
View README.md

It is sort of tricky to run spatial queries against tables in a GeoPackage anywhere, but especially outside of QGIS. This is because we're reliant on Spatialite to carry out those queries and Spatialite is just not well supported. A real shame!

Luckily there are a few resources for helping you get up and going with installing Spatialite for working with GeoPackages in a SQL client like DB Browser.

There is a page in the DB Browser Wik on GitHub called " SpatiaLite on Windows" and it is dedicated to installing Spatialite for use with DB Browser. Note that there are special instructions for a Windows 10 issue.

Bryan McBride at Spatial Networks wrote up a nice piece on working with GeoPackages in DB Browser called "Working with Geospatial Data: An Introduction". It's got a nice walk-thru of how to use DB Browser with GeoPackage as well as some general installation instructions.

View curl_to_ogr2ogr.bash
curl https://url-to-data.com/data.geojson | ogr2ogr -f "ESRI Shapefile" data.shp /vsistdin/
View curl_osgeo4w_cert_workaround.md

Problem

When trying to use cURL from the OSGEO4W shell, it throws the following error:

curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.

View README.md

This is an example of exporting an environment so it can be used to create a new environment. It will also show how to specify a channel that should be included in the build process

First, you'll need to activate the environment you want to use.

activate old-environment

Then export then environment to environment.yml

View agol_map.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Map of single-part geometry data pulled directly from AGOL</title>
</head>
<body>
<!-- Load require.js. Delete this if your page already loads require.js -->
View bad_geojson_pts.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.