Skip to content

Instantly share code, notes, and snippets.

View swidz's full-sized avatar

Sebastian Widz swidz

View GitHub Profile
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.IO.Packaging;
using System.Linq;
using System.Reflection;
@epoplive
epoplive / gist:4562c75edb9eef59f432f1b766d50e54
Last active November 14, 2017 20:09
import geonames data into postgres

GeoNames import to Postgres

This is a guide to getting the raw text formatted GeoNames data dumps structured and imported into a PostGIS database. It imports all related GeoNames data into tables, creates the proper geometry and indexes, as well as foreign key mappings between the tables.

The feature codes list is useful for determining what fcode features you want to extract from the geoname table for use in maps or derivative datasets.

Download source data

wget http://download.geonames.org/export/dump/allCountries.zip
wget http://download.geonames.org/export/dump/alternateNames.zip
@kaspergrubbe
kaspergrubbe / geonames_postgres.rb
Last active April 15, 2025 21:39
Import files from Geonames.com into a PostgreSQL database that runs Postgis
#!/usr/bin/env ruby
require 'open3'
require 'fileutils'
def run_command(command)
puts("+: " + command)
Open3.popen2e(command) do |stdin, stdout_stderr, wait_thread|
Thread.new do
stdout_stderr.each {|l| puts l }
# start GremlinServer
# bin/gremlin-server.sh -i org.apache.tinkerpop gremlin-python 3.2.2-SNAPSHOT
# bin/gremlin-server.sh conf/gremlin-server-modern-py.yaml
from gremlin_python.process.graph_traversal import GraphTraversal
from gremlin_python.process.graph_traversal import GraphTraversalSource
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.traversal import Operator
from gremlin_python.structure.io.graphson import GraphSONReader
@davidfowl
davidfowl / dotnetlayout.md
Last active October 28, 2025 04:47
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@ianare
ianare / country.sql
Last active June 28, 2021 16:01
Import countries to PostgreSQL from geonames data
DROP TABLE "country";
CREATE TABLE "country" (
"iso" character(2) NOT NULL,
"iso3" character(3) NOT NULL,
"iso_numeric" character(3) NOT NULL,
"fips" character(2),
"name" character varying(128) NOT NULL,
"capital" character varying(128),
"area" float,