Skip to content

Instantly share code, notes, and snippets.

View bjornharrtell's full-sized avatar

Björn Harrtell bjornharrtell

View GitHub Profile
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Net.Http.Headers;
namespace DAI.Edit.Backend.WebApi.Controllers
{
[Authorize]
@bjornharrtell
bjornharrtell / smallbuild
Last active November 26, 2019 21:50
gdal
CCACHE_CPP2=yes CC='ccache gcc' CXX='ccache g++' LDFLAGS='-lstdc++' ./configure --disable-all-optional-drivers --enable-driver-flatgeobuf --enable-driver-shape --enable-driver-gpkg --enable-driver-gml --enable-driver-pds --with-pg=no --with-libkml=no --without-lerc --without-libtool
CCACHE_CPP2=yes make USER_DEFS=-Werror -j4
# sanitize...
export LD_LIBRARY_PATH=/usr/lib/llvm-9/lib/clang/9.0.0/lib/linux
CFLAGS="-DMAKE_SANITIZE_HAPPY -fsanitize=undefined -fsanitize=address -fsanitize=unsigned-integer-overflow" CXXFLAGS="-DMAKE_SANITIZE_HAPPY -fsanitize=undefined -fsanitize=address -fsanitize=unsigned-integer-overflow" CCACHE_CPP2=yes LDFLAGS='-fsanitize=undefined -fsanitize=address -lstdc++' ./configure --disable-all-optional-drivers --enable-driver-flatgeobuf --enable-driver-shape --enable-driver-gpkg --enable-driver-gml --enable-driver-pds --with-pg=no --with-libkml=no --without-lerc --without-libtool --enable-debug
sed -i "s/-fsanitize=address/-fsanitize=address -shared-libasan/g" GDALmake.opt
sed -i "s/-fs
@bjornharrtell
bjornharrtell / populate_geometry_columns_table.sql
Created June 20, 2019 09:36 — forked from christippett/populate_geometry_columns_table.sql
MS SQL stored procedure to populate `geometry_columns` table. This table is used by QGIS to identify tables with spatial data.
-- =============================================
-- Author: Chris Tippett
-- Create date: 2014-08-12
-- Description: Detect columns with geometry datatypes and add them to [dbo].[geometry_columns]
-- =============================================
CREATE PROCEDURE [dbo].[Populate_Geometry_Columns] @schema VARCHAR(MAX) = '', @table VARCHAR(MAX) = ''
AS
BEGIN
SET NOCOUNT ON;
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;
#[macro_use] extern crate serde_derive;
extern crate rocket_contrib;
use rocket_contrib::json::{Json};
#[derive(Serialize)]
pub struct User {
find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error*" \) -print
@bjornharrtell
bjornharrtell / components.my-component.js
Last active November 23, 2016 21:29
inline-template
import Ember from 'ember';
export default Ember.Component.extend({
layout: Ember.HTMLBars.compile("<div class='my-decorative-class'>before-yield{{yield}}after-yield</div>"),
template: function() {
return Ember.HTMLBars.compile("I got wrapped")
}
});
@bjornharrtell
bjornharrtell / Dockerfile
Last active October 15, 2017 08:24
postgis-asmvt
FROM debian:stretch
RUN apt-get update -qq && apt-get install -y \
postgresql-9.6 postgresql-server-dev-9.6 \
build-essential autoconf libtool \
libproj-dev libgdal-dev libgeos-dev \
libprotobuf-c-dev curl
RUN service postgresql start && su -l postgres -c "createuser -s `whoami`"
RUN curl --silent -L \
@bjornharrtell
bjornharrtell / topo.txt
Last active October 14, 2016 11:34
topo clean workflow
* Extract linework from input (if polys) with ST_Boundary.
* Load each linestring from linework in separate transactions (or batches) with TopoGeo_AddLineString.
* If multiple lineworks, load them each to a topo separately and start with the linework most wanted as a reference.
* Load reference linework to a new topo.
* Load first topo edge_data in separate transactions per edge, rollback if area created is smaller than wanted.
Create faces with original attributes using two steps.
1. Step 1, create face geometry and point and indexes
@bjornharrtell
bjornharrtell / ST_AsGeobuf.md
Created July 15, 2016 09:18
ST_AsMVT and ST_AsGeobuf

ST_AsGeobuf

Purpose

Support Geobuf as an output format directly from PostGIS.

API

Arguments

@bjornharrtell
bjornharrtell / test.js
Created February 5, 2016 18:31
JSTS #205
import GeoJSONReader from './src/org/locationtech/jts/io/GeoJSONReader'
import GeoJSONWriter from './src/org/locationtech/jts/io/GeoJSONWriter'
import WKTReader from './src/org/locationtech/jts/io/WKTReader'
import GeometryFactory from './src/org/locationtech/jts/geom/GeometryFactory'
import PrecisionModel from './src/org/locationtech/jts/geom/PrecisionModel'
import GeometryGraph from './src/org/locationtech/jts/geomgraph/GeometryGraph'
import ConsistentAreaTester from './src/org/locationtech/jts/operation/valid/ConsistentAreaTester'
import IsSimpleOp from './src/org/locationtech/jts/operation/IsSimpleOp'
import IsValidOp from './src/org/locationtech/jts/operation/valid/IsValidOp'
import patch from './src/org/locationtech/jts/monkey'