Wednesday, July 30, 2014

Undocumented KML Output Conversion, GDAL

As noted here: http://gis.stackexchange.com/questions/18280/batch-convert-geotiffs-to-kmz-files, an undocumented method for conversion to KML exists in GDAL's gdal_translate as format KMLSUPEROVERLAY.  To do this with an existing image, such as a geotiff, your command will be the following format (on Windows):

C:\OSGeo4W64>gdal_translate -of KMLSUPEROVERLAY   FORMAT=JPEG

with an example path, this looks like:

C:\OSGeo4W64>gdal_translate -of KMLSUPEROVERLAY D:\downloads\tile177_12orthos\177.tif D:\downloads\tile177_12orthos\177.kml -co FORMAT=JPEG

This will output a tiled images with a KML to tie them all together.

Monday, July 14, 2014

Disk I/O Error on sqlite/spatialite

On running sqlite CREATE and INSERT queries, I was getting some mysterious errors, like "Error: disk I/O error", despite having the proper permissions on the .sqlite file and adequate space in the directory.  I then broke down the compound query to a simple query and was getting "GEOS error: IllegalArgumentException: Points of LinearRing do not form a closed linestring", though I found that doing Hex(PolygonFromText(...)) did return a hex string.  My WKT was, however, poorly formed.  WKT requires that the final coordinate pair and the beginning coordinate pair are the same, as in  PolyFromText('POLYGON((-75.8 38.4, -75.0 38.4, -75.0 39.85, -75.8 39.85))',4236).  After I fixed that, my more complex queries were able to run successfully.

Tuesday, July 8, 2014

github push 403 and Permission denied

Initially I was getting

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/..

on

$ git push origin master

I read a forum post that recommended

$ vi .git/config

and changing the url line from https://github.com/.. to ssh://github.com/..

and then generating public/private keys and adding this to github.  After doing so I was getting

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

eventually I solve this by changing that url line in .git/config to

url = git@github.com:LOGIN/REPONAME.git

... I also made sure to run

git config --global user.name "LOGIN"
git config --global user.email EMAIL