Skip to content

Instantly share code, notes, and snippets.

View pnorman's full-sized avatar

Paul Norman pnorman

View GitHub Profile
@pnorman
pnorman / log1.log
Created July 10, 2013 06:27
queries from a mapping session in vancouver with josm + continuous download
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8926909,49.2490143,-122.892648,49.2490388
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8926909,49.2490115,-122.892648,49.2490143
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8927063,49.2490388,-122.8926325,49.2490416
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8927063,49.2490115,-122.8926909,49.2490388
http://192.168.1.5:31337/api/0.6/map?bbox=-122.892648,49.2490115,-122.8926325,49.2490388
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8927063,49.2490059,-122.8926325,49.2490115
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8926325,49.2490059,-122.8926201,49.2490416
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8927243,49.2490059,-122.8927063,49.2490416
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8927243,49.2490416,-122.8926201,49.2490483
http://192.168.1.5:31337/api/0.6/map?bbox=-122.8927243,49.2489979,-122.8926201,49.2490059
test done cold hot mem
linestring, apidb, extract 33m28.449s 28m55.834s 7G
way_nodes, pgsnapshot, extract 15m13.645s 10m23.546s 6G
linestring, pgsnapshot, extract 14m22.915s 10m23.181s 4G
parent_ways, pgsnapshot, extract* 14m39.141s 10m12.592s 5G
way_nodes, pgsnapshot, full 37m2.924s 10m10.498s 11G
linestring, pgsnapshot, full 27m40.750s 10m25.437s 8.5G
* Different DB, but same data
@pnorman
pnorman / headers.md
Created July 16, 2013 03:44
headers from cgimap and rails port

== cgimap ==

HTTP/1.1 200 OK
Date: Tue, 16 Jul 2013 03:41:53 GMT
Server: Apache/2.2.22 (Ubuntu)
Content-Disposition: attachment; filename="map.osm"
Content-Encoding: identity
Cache-Control: private, max-age=0, must-revalidate
Vary: Accept-Encoding
Content-Type: text/xml; charset=utf-8
package osmapi
/*
This file is part of openstreetmap-api-testsuite
Copyright (c) 2013 Paul Norman, released under the MIT license.
Defines various test cases for nodes with diff processing
*/
import io.gatling.core.Predef._
import io.gatling.http.Predef._
@pnorman
pnorman / place.sql
Last active December 20, 2015 16:39
from HDM rendering
(SELECT
way,
CASE
WHEN place='country' THEN 1
WHEN place='state' THEN 10
WHEN tags->'is_capital'='country' THEN 20
WHEN place='city' THEN 21
WHEN place='town' THEN 30
ELSE 100
END as prio,
(SELECT
way,
CASE
WHEN place='country' THEN 1
WHEN capital='yes' AND admin_level='2' THEN 10
WHEN place='state' THEN 20
WHEN place='city' THEN 21
WHEN place='town' THEN 30
ELSE NULL
END as prio,
@pnorman
pnorman / default.style
Created August 26, 2013 05:46
draft of a revised default.style
# This is the default osm2pgsql .style file that comes with osm2pgsql.
#
# A .style file has 4 columns that define how OSM objects end up in tables in
# the database and what columns are created.
#
# OsmType: This is either "node", "way" or "node,way" and indicates if this tag
# applies to nodes, ways, or both.
#
# Tag: The tag
#
# This osm2pgsql style file is one that will generate no columns from tags
# It is designed as a starting point for you to develop your own, or for
# use where all OSM tags are in hstore.
# See default.style for documentation on all the flags
# OsmType Tag Type Flags
# Insert your own columns here, or change phstore to polygon below
node,way area:highway text phstore
node,way aeroway text phstore
@pnorman
pnorman / cgimap
Last active December 22, 2015 15:29
An Apache config to handle some requests with cgimap and send others to the main API server
# Adjust as needed for the DocumentRoot. You will need to create the api
# directory, but nothing need be in it
<Directory /var/www/api>
# This section could be placed in a .htaccess file in /var/www/api, but
# the ProxyPreserveHost directive can't. If you don't have access to the
# apache config you won't be able to get OAuth to work
# Enable rewrites
RewriteEngine on
@pnorman
pnorman / data.json
Created September 11, 2013 22:45
WIP of json-schema schema for OSM data
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "OSM Data",
"description": "OSM Data, as returned by the API",
"type": "object",
"properties": {
"version": {
"description": "The OSM API version",
"type": "string",
"enum": ["0.6"]