Skip to content

Instantly share code, notes, and snippets.

View JorgeMartinezG's full-sized avatar

Jorge Martínez Gómez JorgeMartinezG

  • Barranquilla, Colombia
View GitHub Profile
#
# Configuration file for OSM import
#
# put here the name of keys for ways that are assumed to be polygons if they are closed
# see http://wiki.openstreetmap.org/wiki/Map_Features
closed_ways_are_polygons=aeroway,amenity,boundary,building,craft,geological,historic,landuse,leisure,military,natural,office,place,shop,sport,tourism
# comment to avoid laundering of keys ( ':' turned into '_' )
attribute_name_laundering=yes
import pandas as pd
from difflib import SequenceMatcher
from qgis import processing
from qgis.PyQt.QtCore import QVariant
from qgis.processing import alg
from qgis.core import *
MASTER_LAYER = "MASTER_LAYER"
FILE_NAME = "FILE_NAME"
from csv import DictReader
from datetime import datetime, date
from functools import reduce
from os.path import join
work_dir = "/Users/gis/Desktop/pyqgis_workshop_foss4g2023"
gpkg_path = join(work_dir, "naturalearth.gpkg")
layer_name = "ne_10m_admin_1_states_provinces"
import csv
import os
OLD_ICA_PATH = "/Users/jorge/Desktop/SLE_adm2_Dec2016"
NEW_ICA_PATH = "/Users/jorge/OneDrive - World Food Programme/SLE_new/2016/Admin_2/"
OUTPUT_FILE = "/Users/jorge/Desktop/test.csv"
def read_files(path):
files = [
import requests
from urllib.parse import parse_qs
from string import ascii_letters
from random import choice
client_id = ""
client_secret = ""
redirect_uri = "http://127.0.0.1/callback"
auth_url = "https://www.openstreetmap.org/oauth2/authorize"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import requests
import csv
import logging
import os
from arcgis.gis import GIS
from datetime import date
from dotenv import load_dotenv
logger = logging.getLogger()

Install required packages

sudo apt-get install -y autotools-dev \
  libgdal-dev \
  pkg-config \
  gcc \
  build-essential \
  libosmium2-dev \
 libgumbo-dev \

Export variables.

export DBNAME=django
export PGPASSWORD="sdksakdamsd"
export DATABASE_URL="postgis://localhost:5432/$DBNAME?user=gnadmin&password=$PGPASSWORD"
export GEOSERVER_DATA_DIR="/home/stack_sdi/geoserver/data"
export GEOSERVER_LOG_LOCATION="/home/stack_sdi/logs/gs.log"
export JAVA_HOME="/home/stack_sdi/geoserver/jdk1.8.0_251"
export DATA_DIR="/home/sdi/tomcat/webapps/geoserver/data"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.