Gdal Download Python For Mac
четверг 23 апреля admin 70
PyPI has directories for 2.4 (win32 only, with GDAL 1.5, 1.6), 2.5 (mac/win32 with GDAL 1.5, 1.6) and 2.6 (win32 only, with GDAL 1.6). None have GDAL 1.7. If I understand the gist of the answer correctly, you're mainly saying it's not easy and that pip might work in some cases.
Building from Source¶
When installing from source on UNIX and GNU/Linux systems, please followthe installation instructions carefully, and install the libraries in thegiven order. If using MySQL or Oracle as the spatial database, only GEOSis required.
Note
On Linux platforms, it may be necessarry to run the ldconfigcommand after installing each library. For example:
Note
OS X users are required to install Apple Developer Tools in orderto compile software from source. This is typically included on yourOS X installation DVDs.
GEOS¶
GEOS is a C++ library for performing geometric operations, and is the defaultinternal geometry representation used by GeoDjango (it's behind the 'lazy'geometries). Specifically, the C API library is called (e.g., libgeos_c.so)directly from Python using ctypes.
First, download GEOS 3.2 from the refractions Web site and untar the sourcearchive:
Next, change into the directory where GEOS was unpacked, run the configurescript, compile, and install:
Troubleshooting¶
Can't find GEOS Library¶
When GeoDjango can't find GEOS, this error is raised:
The most common solution is to properly configure your Library Environment Settingsor setGEOS_LIBRARY_PATH in your settings.
If using a binary package of GEOS (e.g., on Ubuntu), you may need to Install binutils.
GEOS_LIBRARY_PATH¶
If your GEOS library is in a non-standard location, or you don't want tomodify the system's library path then the GEOS_LIBRARY_PATH settingmay be added to your Django settings file with the full path to the GEOSC library. For example:
Note
The setting must be the full path to the C shared library; inother words you want to use libgeos_c.so, not libgeos.so.
PROJ.4¶
PROJ.4 is a library for converting geospatial data to different coordinatereference systems.
First, download the PROJ.4 source code and datum shifting files [1]:
Next, untar the source code archive, and extract the datum shifting files in thenad subdirectory. This must be done prior to configuration:
Finally, configure, make and install PROJ.4:
PostGIS¶
PostGIS adds geographic object support to PostgreSQL, turning itinto a spatial database. GEOS and PROJ.4 should beinstalled prior to building PostGIS.
Note
The psycopg2 module is required for use as the database adaptorwhen using GeoDjango with PostGIS.
First download the source archive, and extract:
Next, configure, make and install PostGIS:
Finally, make and install:
Note
GeoDjango does not automatically create a spatial database. Pleaseconsult the section on Creating a Spatial Database Template for PostGIS for more information.
GDAL¶
GDAL is an excellent open source geospatial library that has support forreading most vector and raster spatial data formats. Currently, GeoDjango onlysupports GDAL's vector data capabilities [2].GEOS and PROJ.4 should be installed prior to building GDAL.
First download the latest GDAL release version and untar the archive:
Configure, make and install:
Note
Because GeoDjango has it's own Python interface, the preceding instructionsdo not build GDAL's own Python bindings. The bindings may be built byadding the --with-python flag when running configure. SeeGDAL/OGR In Python for more information on GDAL's bindings.
If you have any problems, please see the troubleshooting section below forsuggestions and solutions.
Troubleshooting¶
Can't find GDAL Library¶
When GeoDjango can't find the GDAL library, the HAS_GDAL flagwill be false:
The solution is to properly configure your Library Environment Settingsor setGDAL_LIBRARY_PATH in your settings.
GDAL_LIBRARY_PATH¶
If your GDAL library is in a non-standard location, or you don't want tomodify the system's library path then the GDAL_LIBRARY_PATHsetting may be added to your Django settings file with the full path tothe GDAL library. For example:
Can't find GDAL data files (GDAL_DATA)¶
When installed from source, GDAL versions 1.5.1 and below have an autoconf bugthat places data in the wrong location. [3] This can lead to error messageslike this:
The solution is to set the GDAL_DATA environment variable to the location of theGDAL data files before invoking Python (typically /usr/local/share; usegdal-config--datadir to find out). For example:
If using Apache, you may need to add this environment variable to your configurationfile:
SpatiaLite¶
Note
Mac OS X users should follow the instructions in the KyngChaos Packages section,as it is much easier than building from source.
SpatiaLite adds spatial support to SQLite, turning it into a full-featuredspatial database. Because SpatiaLite has special requirements, it typicallyrequires SQLite and pysqlite2 (the Python SQLite DB-API adaptor) to be built fromsource. GEOS and PROJ.4 should be installed prior to buildingSpatiaLite.
After installation is complete, don't forget to read the post-installationdocs on Creating a Spatial Database for SpatiaLite.
SQLite¶
Typically, SQLite packages are not compiled to include the R*Tree module --thus it must be compiled from source. First download the latest amalgamationsource archive from the SQLite download page, and extract:
Next, run the configure script -- however the CFLAGS environment variableneeds to be customized so that SQLite knows to build the R*Tree module:
Note
If using Ubuntu, installing a newer SQLite from source can be very difficultbecause it links to the existing libsqlite3.so in /usr/lib whichmany other packages depend on. Unfortunately, the best solution at this timeis to overwrite the existing library by adding --prefix=/usr to theconfigure command.
SpatiaLite Library (libspatialite) and Tools (spatialite)¶
After SQLite has been built with the R*Tree module enabled, get the latestSpatiaLite library source and tools bundle from the download page:
Prior to attempting to build, please read the important notes below to see ifcustomization of the configure command is necessary. If not, then run theconfigure script, make, and install for the SpatiaLite library:
Finally, do the same for the SpatiaLite tools:
Note
If you've installed GEOS and PROJ.4 from binary packages, you will have to specifytheir paths when running the configure scripts for both the library and thetools (the configure scripts look, by default, in /usr/local). For example,on Debian/Ubuntu distributions that have GEOS and PROJ.4 packages, the command would be:
Note
For Mac OS X users building from source, the SpatiaLite library and toolsneed to have their target configured:
pysqlite2¶
Because SpatiaLite must be loaded as an external extension, it requires theenable_load_extension method, which is only available in versions 2.5+.Thus, download pysqlite2 2.6, and untar:
Next, use a text editor (e.g., emacs or vi) to edit the setup.cfg fileto look like the following:
Leawo blu ray key code. The comprehensive playback navigation within this Blu-ray player software allows people to easily browse and play Blu-ray/DVD or video content. Meanwhile, this powerful Blu-ray player software wonderfully offers a range of features that greatly enhance the overall viewing experience. According to Leawo Software, the program could be used as a free Blu-ray, DVD, and video/audio player to play Blu-ray/DVD discs and IFO files, common videos, HD 1080p videos and audio files in various formats for life-long free.As professional Blu-ray/DVD media player software, Leawo Blu-ray Player could play back all kinds of Blu-ray and DVD discs from various countries and regions without quality loss.
Note
The important thing here is to make sure you comment out thedefine=SQLITE_OMIT_LOAD_EXTENSION flag and that the include_dirsand library_dirs settings are uncommented and set to the appropriatepath if the SQLite header files and libraries are not in /usr/includeand /usr/lib, respectively.
After modifying setup.cfg appropriately, then run the setup.py scriptto build and install: