Skip to content

Instantly share code, notes, and snippets.

View abruzzi's full-sized avatar
⌨️
Writing a React book - React Anti-Patterns

Juntao Qiu abruzzi

⌨️
Writing a React book - React Anti-Patterns
View GitHub Profile
@abruzzi
abruzzi / openlayers-geojson-styleing.js
Last active August 29, 2015 13:59
How to styling the openlayer vector layers (generated by geojson)
app.controller('EventController',
['$scope', '$compile', '$timeout', function($scope, $compile, $timeout) {
var map = new OpenLayers.Map("map");
var osm = new OpenLayers.Layer.OSM();
var style = new OpenLayers.Style();
var ruleLow = new OpenLayers.Rule({
filter: new OpenLayers.Filter.Function({
@abruzzi
abruzzi / arcgis-layers-overlay-osm.js
Last active August 29, 2015 13:59
integrate arcgis services with openlayers
var app = angular.module('OpenLayersApp', []);
app.controller('EventController',
['$scope', '$compile', '$timeout', function($scope, $compile, $timeout) {
var map = new OpenLayers.Map("map", {
projection: "EPSG:102113",
units: "m"
});
@abruzzi
abruzzi / buffer.xml
Last active August 29, 2015 14:00
GML and WPS execute with OpenLayers
<?xml version="1.0" encoding="UTF-8"?>
<gml:FeatureCollection xmlns:gml="http://www.opengis.net/gml" xmlns:bufferAnalyse_Buffer="http://nassvr.com:6080/arcgis/services/bufferAnalyse/Buffer/GPServer/WPSServer" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nassvr.com:6080/arcgis/services/bufferAnalyse/Buffer/GPServer/WPSServer http://10.144.167.24:6080/arcgis/services/bufferAnalyse/Buffer/GPServer/WPSServer?request=getschema%26version=1.0.0%26service=WPS%26identifier=Buffer%26parameter=out_feature_class">
<gml:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG:6.9:4326">
<gml:lowerCorner>25.434950352377712 -120.85450040476928</gml:lowerCorner>
<gml:upperCorner>46.235549479625718 -70.579373672955967</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<gml:featureMember>
<bufferAnalyse_Buffer:out_feature_class>
@abruzzi
abruzzi / exifr2geojson.rb
Last active August 29, 2015 14:01
places I have been in Xi'an
require 'json'
require 'base64'
require 'exifr'
def to_decimal(dms)
dms[0].to_f + dms[1].to_f / 60 + dms[2].to_f / 3600
end
def to_geojson(exif)
lat_exif = exif.gps_latitude
@abruzzi
abruzzi / gis-frontend.dot
Last active August 29, 2015 14:01
GIS WPS topology
digraph gis_frontend{
fontname="Microsoft YaHei";
fontsize=12;
rankdir=LR;
splines=line;
node [shape="Mrecord", fontname="Microsoft YaHei", fontsize=10];
edge [color="#F1C40F", fontname="Microsoft YaHei", fontsize=10];
openlayers [shape="none", image="OpenLayers.trac.png", label=""];
@abruzzi
abruzzi / index.html
Created May 12, 2014 12:51
render geojson in hexagon with leaflet
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>A Simple Map</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/d3.hexbin.v0.js"></script>
@abruzzi
abruzzi / core-site.xml
Last active August 29, 2015 14:01
Hadoop + Hive + Sqoop notes
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://ubuntu:9000</value>
</property>
<property>
@abruzzi
abruzzi / hive-site.xml
Last active August 29, 2015 14:01
How to solve the readObject: can not find class org.apache.hadoop.hive.commom.conf.HiveConf
<property>
<name>fs.default.name</name>
<value>hdfs://nameservice1:8020/</value>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://nameservice1:8020/</value>
</property>
<property>
<name>mapreduce.framework.name</name>
@abruzzi
abruzzi / misc.md
Last active August 29, 2015 14:01
Spark + shark on hadoop yarn

一些应该注意的点

如何在Hive中创建表
CREATE EXTERNAL TABLE IF NOT EXISTS roads (Name string, Layer string, Shape binary)
ROW FORMAT SERDE 'com.esri.hadoop.hive.serde.JsonSerde'
STORED AS INPUTFORMAT 'com.esri.json.hadoop.EnclosedJsonInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION '${env:HOME}/sampledata/roads'; 
@abruzzi
abruzzi / gis-on-hadoop.dot
Created May 22, 2014 01:44
hadoop cluster
digraph gis_hadoop{
fontname="Microsoft YaHei";
fontsize=12;
splines=line;
node [shape="Mrecord", fontname="Microsoft YaHei", fontsize=10];
edge [color="#F1C40F", fontname="Microsoft YaHei", fontsize=10];
oozie [label="workflow", shape="none", image="oozie-logo.png", labelloc="b"];