Taken from: https://stackoverflow.com/a/33354920/1177832
# 0. Your file name
FNAME=some.file
# 1. Somehow sanitize the file content
# Remove \r (from Windows end-of-lines),
# Replace tabs by \tTaken from: https://stackoverflow.com/a/33354920/1177832
# 0. Your file name
FNAME=some.file
# 1. Somehow sanitize the file content
# Remove \r (from Windows end-of-lines),
# Replace tabs by \t| <?xml version="1.0"?> | |
| <kml xmlns="http://www.opengis.net/kml/2.2"> | |
| <Document> | |
| <Placemark> | |
| <name>1</name> | |
| <TimeStamp> | |
| <when>2005-08-21T09:01:00Z</when> | |
| </TimeStamp> | |
| <Point> | |
| <coordinates>147.8641248483198,-41.20691100053718,650.3999223664766</coordinates> |
| { | |
| "type": "FeatureCollection", | |
| "features": [ | |
| { | |
| "type": "Feature", | |
| "properties": { | |
| "id": 0, | |
| "age": 1, | |
| "time": "2005-08-22T09:01:00Z" | |
| }, |
| { | |
| "editor.tabSize": 2, | |
| "editor.formatOnSave": true, | |
| "workbench.colorTheme": "Darkula", | |
| "workbench.editor.enablePreview": false, | |
| "eslint.run": "onType", | |
| "eslint.autoFixOnSave": true, | |
| "liveServer.settings.donotVerifyTags": true, | |
| "liveServer.settings.donotShowInfoMsg": true, | |
| "javascript.updateImportsOnFileMove.enabled": "always", |
| import gdal | |
| from gdalconst import GA_ReadOnly | |
| data = gdal.Open('C:/Temp/myimage.tif', GA_ReadOnly) | |
| geoTransform = data.GetGeoTransform() | |
| minx = geoTransform[0] | |
| maxy = geoTransform[3] | |
| maxx = minx + geoTransform[1] * data.RasterXSize | |
| miny = maxy + geoTransform[5] * data.RasterYSize | |
| print (minx, miny, maxx, maxy) |
| <!--https://stackoverflow.com/a/39731911/1177832--> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.js"></script> | |
| <style> | |
| .node { | |
| fill: #dddddd; | |
| stroke: gray; |
-L 3 == 3 levels deep
-I node_modules ignore
tree -v -L 3 --charset utf-8 -I node_modules
| # setup | |
| from cdo import * | |
| cdo = Cdo() | |
| cdo.debug = True | |
| in_file = '/path/to/in_file.nc' | |
| out_file = '/path/to/out_file.nc' | |
| date1 = '2018-03-01T00:00:00' | |
| date2 = '2018-03-01T02:00:00' | |
| # my target is in meters |
| import gdal | |
| in_file = '/Users/foo/Desktop/reproject/before.tif' | |
| out_file = '/Users/foo/Desktop/reproject/after.tif' | |
| # minX, minY, maxX, maxY | |
| new_bounds = [ | |
| -78.0078239440917969, | |
| -40.0333147430419922, | |
| -66.0144157409667969, |
| let myJSON = JSON.stringify(objectToClone, function(key, value){ | |
| if(key == "troublesomeProperty"){ | |
| return undefined; | |
| } | |
| return value; | |
| }); |