This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#****************************************************************************** | |
# $Id$ | |
# | |
# Name: gdalcopyproj.py | |
# Project: GDAL Python Interface | |
# Purpose: Duplicate the geotransform and projection metadata from | |
# one raster dataset to another, which can be useful after | |
# performing image manipulations with other software that | |
# ignores or discards georeferencing metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import json | |
from lxml.etree import XMLParser, parse | |
parser = XMLParser(huge_tree=True) | |
namespaces = { | |
"gml": "http://www.opengis.net/gml", | |
"fme": "http://www.safe.com/gml/fme"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml.etree import XMLParser, parse | |
import networkx as nx | |
# from collections import defaultdict | |
DATA_DIRECTORY = "" | |
i_path = f"{DATA_DIRECTORY}/INTERSECTION.gml" | |
cl_path = f"{DATA_DIRECTORY}/CENTERLINE.gml" | |
parser = XMLParser(huge_tree=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use lxml to parse GML | |
from lxml.etree import XMLParser, parse | |
PLATE_LINE_PATH = "DTAD_DS_PLATE_LINE.gml" # file path of the direction plate GML | |
SCALE = 100 # scale for SVG | |
# namespaces for easier xml data extraction | |
namespaces = {"core": "http://www.opengis.net/citygml/2.0", | |
"gen": "http://www.opengis.net/citygml/generics/2.0", | |
"gml": "http://www.opengis.net/gml"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Newtonsoft.Json; // This has to be installed to parse json | |
// the class name should be renamed accordingly | |
public class PathGenerate : MonoBehaviour | |
{ | |
// Make a field in Unity Editor to select the geojson file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
# largest grid (1-19) east: 15000m, north: 12000m | |
# start_coord = (800000, 848000) | |
# Calculation of starting HK80 Coordinates with known map sheet index | |
# Divide 4 parts, first part is base coordinate, part2-4 are addition of E/N coordinates | |
# Each part with value checking | |
def part1(a): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.parse import urlparse | |
import urllib.request | |
from pathlib import Path | |
# [1-17] [NW/NE/SW/SE] [1-25] [A/B/C/D] [1-20] | |
for i in range(1,18): | |
for j in ['NW', 'NE', 'SW', 'SE']: | |
for k in range(1, 26): | |
for l in ['A', 'B', 'C', 'D']: | |
for m in range(1, 21): |