Skip to content

Instantly share code, notes, and snippets.

@geographika
geographika / nuclear-power-stations.map
Created November 1, 2022 17:17
Mapfile for Day 1 of 2022 #30DayMapChallenge: Points
MAP
NAME "Nuclear Power Map"
EXTENT -1622777.025136114 5036320.52109153 2617519.4114628565 8597992.10957372
PROJECTION
"init=epsg:3857"
END
SYMBOL
NAME "nuclear"
TYPE PIXMAP
IMAGE "nuclear-power-plant.png"
@geographika
geographika / ogr2ogr_ZMs.txt
Created May 21, 2020 19:14
Convert "3D Multi Line String" geoms to "Geometry: 3D Measured Multi Line String" (add measures) in a spatialite db using ogr2ogr
-- Convert "3D Multi Line String" geoms to "Geometry: 3D Measured Multi Line String" (add measures)
-- in a spatialite db using ogr2ogr
ogr2ogr -update -f "SQLite" db.sqlite db.sqlite -nln "OutputGeomsZM" -sql "SELECT ObjectId, geom FROM SourceTable" -overwrite -nlt MULTILINESTRINGZM
ogrinfo db.sqlite OutputGeomsZM -so
import re
import os
import glob
# https://stackoverflow.com/questions/53082965/how-can-i-match-a-restructuredtext-code-block-with-regex-and-python
def update_index_directive(directive):
"""
root@php-mapscript:/build/mapserver/build# sudo cmake .. -DCMAKE_BUILD_TYPE=Release \
> -DWITH_CLIENT_WFS=ON \
> -DWITH_CLIENT_WMS=ON \
> -DWITH_CURL=ON \
> -DWITH_GDAL=ON \
> -DWITH_GIF=ON \
> -DWITH_ICONV=ON \
> -DWITH_KML=ON \
> -DWITH_LIBXML2=ON \
> -DWITH_OGR=ON \
This file has been truncated, but you can view the full file.
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.0
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
This file has been truncated, but you can view the full file.
%includefile "/usr/share/swig/4.0.0/swig.swg" %beginfile
/* -----------------------------------------------------------------------------
* swig.swg
*
* Common macro definitions for various SWIG directives. This file is always
* included at the top of each input file.
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* User Directives
@geographika
geographika / ows_user.py
Created August 24, 2016 21:00
Sample OWS user for Locust
"""
To run, edit layer name, host, application path and bounding boxes.
Then:
locust -f ows_user.py --host=http://ubuntu-mapserver
http://localhost:8089
"""
from locust import HttpLocust, TaskSet, task
(function () {
Ext.define('GeoExt.tree.ParameterLoader', {
requires: [
'GeoExt.tree.LayerParamNode'
],
extend: 'GeoExt.tree.LayerLoader',
/**
* @require OpenLayers/Layer.js
*/
(function () {
/**
An extended overlay container node, which automatically turns child layers on and off
*/
Ext.define('GeoExt.tree.ParameterLayerContainer', {
@geographika
geographika / LayerParamNode.js
Last active September 5, 2015 18:54
GeoExt.tree.LayerParamNode work in progress
/*
* Copyright (c) 2008-2015 The Open Source Geospatial Foundation
*
* Published under the BSD license.
* See https://github.com/geoext/geoext2/blob/master/license.txt for the full
* text of the license.
*/
/*
* @requires GeoExt/Version.js