Skip to content

Instantly share code, notes, and snippets.

View nside's full-sized avatar

Denis Laprise nside

View GitHub Profile
@nside
nside / mediawiki.proto
Created December 27, 2022 16:09
Wikipedia export schema in Protocol Buffer
syntax = "proto3";
package org.mediawiki.www.xml.export_0_3;
enum CaseType {
// Default
CASE_TYPE_UNSPECIFIED = 0;
CASE_TYPE_FIRST_LETTER = 1;
CASE_TYPE_CASE_SENSITIVE = 2;
CASE_TYPE_CASE_INSENSITIVE = 3;
}
# This code reads a set of latitude and longitude coordinates from a csv file, creates a dictionary of Point objects using the shapely library, and then creates a MultiLineString object using the Point objects. It then takes the union of the MultiLineString object to create a single shape representing a road network. The road network is then buffered by a small amount and written to a geojson file.
# The latitude and longitude coordinates in the input csv file likely represent the nodes (intersections or endpoints) of a road network, and the edges (roads) connecting the nodes are inferred from the input file. The Point objects are created using these coordinates, and the LineString objects representing the edges are created by connecting the Point objects. The union of the LineString objects is then taken to create the final road network shape.
import csv, json
from shapely.geometry import LineString, MultiLineString, Point, MultiPoint, mapping
from shapely.ops import unary_union
from shapely.geometry import
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Virgil about to enter the gates of Hell, Dante Alighieri, Auguste Rodin, sf, intricate artwork masterpiece, ominous, matte painting movie poster, golden ratio, trending on cgsociety, intricate, epic, trending on artstation, highly detailed, vibrant, production cinematic character render, ultra high quality model, no red
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.