This file contains 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
<?php | |
/** | |
* PostGIS to GeoJSON | |
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc. | |
* | |
* @param string $geotable The PostGIS layer name *REQUIRED* | |
* @param string $geomfield The PostGIS geometry field *REQUIRED* | |
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)* | |
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes | |
* @param string $parameters SQL WHERE clause parameters *OPTIONAL* |
This file contains 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
<?php | |
/** | |
* SQLite to GeoJSON (Requires https://github.com/phayes/geoPHP) | |
* Query a SQLite table or view (with a WKB GEOMETRY field) and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc. | |
* | |
* @param string $geotable The SQLite table name *REQUIRED* | |
* @param string $geomfield The WKB GEOMETRY field *REQUIRED* | |
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* | |
* @param string $parameters SQL WHERE clause parameters *OPTIONAL* | |
* @param string $orderby SQL ORDER BY constraint *OPTIONAL* |
This file contains 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
/********************************************************************* | |
Original Source: https://github.com/jmckenna/basemaps/blob/master/contrib/osm2pgsql-to-imposm-schema.sql | |
Modified for use in creating shapefiles to replace in TileMill Open Streets, DC project | |
Purpose: This script will modify tables generated through the osm2pgsql | |
utilility [1] into tables similar to those as generated from the | |
imposm utility [2]. The generated tables can then be used | |
by the mapserver-utils utility [3]. | |
This is most likely useful for the Windows platform. |
This file contains 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
function toWKT(layer) { | |
var lng, lat, coords = []; | |
if (layer instanceof L.Polygon || layer instanceof L.Polyline) { | |
var latlngs = layer.getLatLngs(); | |
for (var i = 0; i < latlngs.length; i++) { | |
latlngs[i] | |
coords.push(latlngs[i].lng + " " + latlngs[i].lat); | |
if (i === 0) { | |
lng = latlngs[i].lng; | |
lat = latlngs[i].lat; |
This file contains 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
Sub RedistributeData() | |
Dim X As Long, LastRow As Long, A As Range, Table As Range, Data() As String | |
Const Delimiter As String = ", " | |
Const DelimitedColumn As String = "B" | |
Const TableColumns As String = "A:B" | |
Const StartRow As Long = 2 | |
Application.ScreenUpdating = False | |
LastRow = Columns(TableColumns).Find(What:="*", SearchOrder:=xlRows, _ | |
SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row | |
For X = LastRow To StartRow Step -1 |
This file contains 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
$('input[name="basemapLayers"]').change(function () { | |
// Remove unchecked layers | |
$('input:radio[name="basemapLayers"]:not(:checked)').each(function () { | |
map.removeLayer(window[$(this).attr('id')]); | |
}); | |
// Add checked layer | |
$('input:radio[name="basemapLayers"]:checked').each(function () { | |
map.addLayer(window[$(this).attr('id')]); | |
}); | |
}); |
This file contains 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
ogr2ogr -update -append -f SQLite mydb.sqlite -nln "newtable" -a_srs "EPSG:4326" shapefile.shp |
This file contains 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
<?php | |
$ch = curl_init($_GET['url']); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($ch); | |
curl_close($ch); | |
echo $output; | |
?> |
This file contains 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
convert glyphicons_195_circle_info.png -fuzz 100% -fill "rgb(187,187,187)" -opaque black glyphicons_195_circle_info-gray.png |
This file contains 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
SINGLE FILE CONVERT | |
gdal_translate input_nysdop_ortho.jp2 output.tif -b 1 -b 2 -b 3 -mask 4 -co COMPRESS=JPEG -co JPEG_QUALITY=25 -co PHOTOMETRIC=YCBCR --config GDAL_TIFF_INTERNAL_MASK YES -a_srs EPSG:2260 | |
BATCH CONVERT | |
for /r %g in (*.jp2) do gdal_translate -of GTiff "%g" "%~dpng.tif" -b 1 -b 2 -b 3 -mask 4 -co COMPRESS=JPEG -co JPEG_QUALITY=25 -co PHOTOMETRIC=YCBCR --config GDAL_TIFF_INTERNAL_MASK YES -a_srs EPSG:2260 | |
BUILT VIRTUAL RASTER (CATALOG) | |
gdalbuildvrt catalog.vrt e_06811416_06_05000_4bd_2011.jp2 e_06811414_06_05000_4bd_2011.jp2 e_06781416_06_05000_4bd_2011.jp2 e_06781414_06_05000_4bd_2011.jp2 | |
gdalbuildvrt -allow_projection_difference -hidenodata -vrtnodata "255 255 255" nysdop.vrt *.jp2 -a_srs EPSG:2260 |
OlderNewer