View arcpy_extract_services_py3.py
import arcpy
import json
import urllib
arcpy.env.overwriteOutput = True
baseURL = "http://services.gis.ca.gov/arcgis/rest/services/Environment/Wildfires/MapServer/0"
fields = "*"
out_data = "H:/cal_data/data.gdb/testdata"
# Get record extract limit
View AccessPoints_LOS_20180301.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View esrijson.json
{
"displayFieldName": "NAME",
"fieldAliases": {
"OBJECTID": "OBJECTID",
"NAME": "NAME",
"PARK_TYPE": "PARK_TYPE",
"FILE_NUMBER": "FILE_NUMBER",
"ID_NUMBER": "ID_NUMBER",
"DEVELOPED": "DEVELOPED",
"MAP_ACRES": "MAP_ACRES",
View index.html
<html>
<head>
<meta charset=utf-8 />
<title>route to the closest facility</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.2.0"></script>
View randomFCSample.py
import arcpy
import numpy as np
def randomFCSample(fc, fd='sample_fd', sample_field='OBJECTID', sample_pct=10):
count_class = arcpy.GetCount_management(fc)
count = int(count_class[0])
random_vals = np.random.choice(count, int(count*(sample_pct/100)))
arcpy.MakeFeatureLayer_management(fc,
fd + "_" + str(sample_pct) + 'pct',
sample_field + ' IN ' + str(tuple(random_vals)))
View test_track.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View TEMPLATE.mapx
{
"type" : "CIMMapDocument",
"version" : "2.0.0",
"build" : 8933,
"mapDefinition" : {
"type" : "CIMMap",
"name" : "TEMPLATE",
"uRI" : "CIMPATH=map6/map6.xml",
"sourceModifiedTime" : {
"type" : "TimeInstant"
View qgis-osx-error-solved.md

I installed QGIS (KyngChaos) after installing Miniconda. When I would open QGIS, I'd get an error about MetaSearch not started because requests couldn't be found. How I got things working again

Alias system Python 2.7 (This may be optional)

sudo alias python2=/usr/bin/python2.7

Get a copy of get-pip.py and use it to install pip

sudo /usr/bin/python2.7 /Users/maptastik/get-pip.py

View GDBtoPostGIS.md

Generally I can use QGIS and its DBManager to import data into a PostGIS database. Sometimes that doesn't work perfectly. ogr2ogr can help though. Running this little command seems to work (Source)

ogr2ogr -overwrite -f "PostgreSQL" PG:"host=<host> user=<username> dbname=<db name> password=<password> port=<port #>" "C:\some.gdb" "<feature class>" -nln <new table name> -nlt <geometry type>
View UsefulSQL.md

Get a list of duplicate records and how many duplicates there of that record

SELECT DISTINCT SOME_FIELD, count(*)
FROM SOME_TABLE
GROUP BY SOME_FIELD
HAVING count(*) > 1

Spatial join based that adds polygon values (b) to intersecting point features (a). Be aware that this does not return a value for those points that are outside a polygon feature