Skip to content

Instantly share code, notes, and snippets.

View odoe's full-sized avatar
👽
It's full of stars

Rene Rubalcava odoe

👽
It's full of stars
View GitHub Profile
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
<title>Map components AMD template</title>
<link rel="icon" href="data:;base64,=" />
<style>
@odoe
odoe / gulpfile.js
Created February 11, 2016 19:04
Sample gulpfile for Dojo builds
var gulp = require('gulp');
var clean = require('gulp-clean');
var rename = require("gulp-rename");
var spawn = require('child_process').spawn;
gulp.task('clean-dist', function () {
return gulp.src('dist/', { read: false })
.pipe(clean());
});
@odoe
odoe / geotofeature.py
Created September 10, 2012 21:13
ArcPy script to Convert GeoJSON to Feature Classes
# This is a script that I use to convert geojson to
# features in a file gdb
# Step 1. Use the REST page of an ArcGIS Map Service to
# get the esri json results of the data you want.
# Step 2. I used my EsriJSON to GeoJSON app to convert
# the results to geojson. http://esritogeo.herokuapp.com/
# Step 3. In ArcMap, use the python window to create a
# python dictionary of your geojson.
# Step4. Use the following script to convert that geojson
# into featureclasses and then merge them.
@odoe
odoe / esrileaf.html
Created April 19, 2012 21:08
Demo of Backbone.js using ESRI REST in Leaflet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content='text/html, charset=UTF-8' http-equiv='Content-Type' />
<meta content='IE=7,IE=8,IE=9' http-equiv='X-UA-Compatible' />
<meta content='initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' />
<style type="text/css">
@import url("http://code.leafletjs.com/leaflet-0.3.1/leaflet.css");
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@odoe
odoe / pagedpopup.js
Last active January 21, 2023 20:04
A custom popup pager for multiple features for use with Leaflet.js.
/*jshint laxcomma:true*/
/**
* The following uses RxJS to handle the
* next/prev click event stream
* https://github.com/Reactive-Extensions/RxJS
* Could substitute with regular addEventListener
* if desired.
*
* It also uses font-awesome for next/prev icons
@odoe
odoe / .spacemacs
Last active October 20, 2022 07:32
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@odoe
odoe / leaflet-search-control.js
Last active October 6, 2021 19:38
Leaflet sample search control
function sortParks(a, b) {
var _a = a.feature.properties.park;
var _b = b.feature.properties.park;
if (_a < _b) {
return -1;
}
if (_a > _b) {
return 1;
}
return 0;
import React, { useRef, useEffect, useState } from "react";
import ArcGISMap from "@arcgis/core/Map";
import MapView from "@arcgis/core/views/MapView";
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";
import clasess from "./esri-map.module.css";
import { func } from "prop-types";
const layers = [
{
layerId: 1,
@odoe
odoe / vector-tile-pr.md
Last active January 5, 2021 02:40
Indexing of Vector Tiles (Clipping Justification)

Indexing of Vector Tiles (Clipping Justification)

This pull-request provides the ability to display vector tile trees containing leaves at different levels of detail (LOD) based on data density. This requires clipping tiles when zoomed in beyond a physically present leaf and using an index to determine tile presence.

Purpose

The goal is to efficiently cook tiles and still maintain a high level of data precision in vector tiles. We can achieve this by limiting the cooking of tiles to a satisfactory LOD in less geometrically dense areas. On the consumer side, clipping can be used to clip larger tiles to fit a more precise LOD as needed. This methodology also provides over-zooming of tiles beyond the LOD limit of the current Vector Tile specification.