NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
This little trick derives from the fact that the from_postgis
class method is not really specific to postgis at all;
it will work with sqlalchmey or dbapi2 connections.
However, there are some peculiarities with spatialite
that prevent this from being as simple as one might hope. There are two options:
The pysqlite2
driver works great for vanilla sqlite3 databases but spatialite requires loading an extension. In order to load extensions, you need to install a patched version and do some manual loading of the shared library. (see the_pysqlite2_way.py
)
A better alternative is to use pyspatialite
but installation is also a bit funky. I had to install from the current git master instead of the pypi version. The extension is loaded automatically. (see the_pyspatialite_way.py
)
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
/* | |
* I add this to html files generated with pandoc. | |
*/ | |
html { | |
font-size: 100%; | |
overflow-y: scroll; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
} |
The difference between XYZ and TMS tiles and how to convert between them
Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles
ending in /0/0/0.png
or something. Sometimes if it's a script, it'll look like
&z=0&y=0&x=0
instead. Anyway, these are usually maps in Spherical Mercator.
Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.
Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.
~/local/filegdb
. Here's an example path to one of the files: ~/local/filegdb/lib/libFileGDBAPI.dylib
~/local/filegdb
so it can stay isolated in it's own place. You can put it anywhere, but the next few steps might be different.~/local/filegdb
@rpath
's, so to avoid needing to mess with DYLD_LIBRARY_PATH
, I updated the @rpath
's using install_name_tool
. There might be a more elegant way to handle this. If so, comments are welcome!DYLD_LIBRARY_PATH
yourself: