From: <js...@us...> - 2007-11-10 14:10:36
|
Revision: 4203 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4203&view=rev Author: jswhit Date: 2007-11-10 06:10:32 -0800 (Sat, 10 Nov 2007) Log Message: ----------- add utilities for processing GMT boundaries Added Paths: ----------- trunk/toolkits/basemap-testing/utils/ trunk/toolkits/basemap-testing/utils/README trunk/toolkits/basemap-testing/utils/dumpbounds.sh trunk/toolkits/basemap-testing/utils/dumpcoast.sh trunk/toolkits/basemap-testing/utils/readboundaries.py Added: trunk/toolkits/basemap-testing/utils/README =================================================================== --- trunk/toolkits/basemap-testing/utils/README (rev 0) +++ trunk/toolkits/basemap-testing/utils/README 2007-11-10 14:10:32 UTC (rev 4203) @@ -0,0 +1,3 @@ +1) run dumpcoast.sh and dumpbounds.sh to dump GMT boundaries into text files. +2) run readboundaries.py to process into binary files, with metadata in +text files. Added: trunk/toolkits/basemap-testing/utils/dumpbounds.sh =================================================================== --- trunk/toolkits/basemap-testing/utils/dumpbounds.sh (rev 0) +++ trunk/toolkits/basemap-testing/utils/dumpbounds.sh 2007-11-10 14:10:32 UTC (rev 4203) @@ -0,0 +1,16 @@ +#!/bin/sh +area=10000000000000000000000000000000 +pscoast -M -Dc -R0/360/-90/90 -N1 -JQ180/4.5i -W -A${area} > countries_c.txt +pscoast -M -Dc -R0/360/-90/90 -N2 -JQ180/4.5i -W -A${area} > states_c.txt +pscoast -M -Dl -R0/360/-90/90 -N1 -JQ180/4.5i -W -A${area} > countries_l.txt +pscoast -M -Dl -R0/360/-90/90 -N2 -JQ180/4.5i -W -A${area} > states_l.txt +pscoast -M -Di -R0/360/-90/90 -N1 -JQ180/4.5i -W -A${area} > countries_i.txt +pscoast -M -Di -R0/360/-90/90 -N2 -JQ180/4.5i -W -A${area} > states_i.txt +pscoast -M -Dh -R0/360/-90/90 -N1 -JQ180/4.5i -W -A${area} > countries_h.txt +pscoast -M -Dh -R0/360/-90/90 -N2 -JQ180/4.5i -W -A${area} > states_h.txt +pscoast -M -Df -R0/360/-90/90 -N1 -JQ180/4.5i -W -A${area} > countries_f.txt +pscoast -M -Df -R0/360/-90/90 -N2 -JQ180/4.5i -W -A${area} > states_f.txt +pscoast -M -Dc -R0/360/-90/90 -Ir -JQ180/4.5i -W -A${area} > rivers_c.txt +pscoast -M -Dl -R0/360/-90/90 -Ir -JQ180/4.5i -W -A${area} > rivers_l.txt +pscoast -M -Di -R0/360/-90/90 -Ir -JQ180/4.5i -W -A${area} > rivers_i.txt +pscoast -M -Dh -R0/360/-90/90 -Ir -JQ180/4.5i -W -A${area} > rivers_h.txt Added: trunk/toolkits/basemap-testing/utils/dumpcoast.sh =================================================================== --- trunk/toolkits/basemap-testing/utils/dumpcoast.sh (rev 0) +++ trunk/toolkits/basemap-testing/utils/dumpcoast.sh 2007-11-10 14:10:32 UTC (rev 4203) @@ -0,0 +1,2 @@ +#!/bin/csh +pscoast -M -Dl -R0.001/360/-90/90 -JQ180/4.5i -A5000 -W >! GMT_coastlines.txt Added: trunk/toolkits/basemap-testing/utils/readboundaries.py =================================================================== --- trunk/toolkits/basemap-testing/utils/readboundaries.py (rev 0) +++ trunk/toolkits/basemap-testing/utils/readboundaries.py 2007-11-10 14:10:32 UTC (rev 4203) @@ -0,0 +1,158 @@ +import numpy, sys + +lsd = 3 + +def quantize(data,least_significant_digit): + """ + +quantize data to improve compression. data is quantized using +around(scale*data)/scale, where scale is 2**bits, and bits is determined +from the least_significant_digit. For example, if +least_significant_digit=1, bits will be 4. + +This function is pure python. + + """ + precision = pow(10.,-least_significant_digit) + exp = numpy.log10(precision) + if exp < 0: + exp = int(numpy.floor(exp)) + else: + exp = int(numpy.ceil(exp)) + bits = numpy.ceil(numpy.log2(pow(10.,-exp))) + scale = pow(2.,bits) + return numpy.around(scale*data)/scale + +def get_coast_polygons(coastfile,area_thresh=-1.,latmin=-91.,latmax=91.): + polymeta = []; polybounds = [] + lats = []; lons = [] + for line in open(coastfile): + linesplit = line.split() + if line.startswith('P'): + area = float(linesplit[5]) + west,east,south,north = float(linesplit[6]),float(linesplit[7]),float(linesplit[8]),float(linesplit[9]) + typ = int(linesplit[3]) + useit = latmax>=south and latmin<=north and area>area_thresh + if useit: + polymeta.append((typ,area,south,north)) + if lons: + #lons.append(lons[0]); lats.append(lats[0]) + b = numpy.empty((len(lons),2),numpy.float32) + b[:,0] = lons; b[:,1] = lats + if lsd is not None: + b = quantize(b,lsd) + polybounds.append(b) + lats = []; lons = [] + continue + if useit: + lon, lat = [float(val) for val in linesplit] + lons.append(lon); lats.append(lat) + #lons.append(lons[0]); lats.append(lats[0]) + b = numpy.empty((len(lons),2),numpy.float32) + b[:,0] = lons; b[:,1] = lats + if lsd is not None: + b = quantize(b,lsd) + polybounds.append(b) + polymeta2 = [] + for meta,bounds in zip(polymeta,polybounds): + npts = bounds.shape[0] + polymeta2.append(meta+(npts,)) + return polybounds, polymeta2 + +def get_boundary_lines(bdatfile,latmin=-91.,latmax=91.): + polymeta = []; polybounds = [] + lons = []; lats = [] + for line in open(bdatfile): + linesplit = line.split() + if line.startswith('>'): + west,east,south,north = float(linesplit[7]),float(linesplit[8]),float(linesplit[9]),float(linesplit[10]) + useit = latmax>=south and latmin<=north + if useit: + polymeta.append((south,north)) + if lons: + b = numpy.empty((len(lons),2),numpy.float32) + b[:,0] = lons; b[:,1] = lats + if lsd is not None: + b = quantize(b,lsd) + polybounds.append(b) + lons = []; lats = [] + continue + if useit: + lon, lat = [float(val) for val in linesplit] + lats.append(lat); lons.append(lon) + b = numpy.empty((len(lons),2),numpy.float32) + b[:,0] = lons; b[:,1] = lats + if lsd is not None: + b = quantize(b,lsd) + polybounds.append(b) + polymeta2 = [] + polybounds2 = [] + for meta,bounds in zip(polymeta,polybounds): + npts = bounds.shape[0] + if npts == 2 and\ + bounds[0,0] == bounds[1,0] and\ + bounds[0,1] == bounds[1,1]: continue + polybounds2.append(bounds) + polymeta2.append(meta+(npts,)) + return polybounds2, polymeta2 + +# read in coastline data (only those polygons whose area > area_thresh). +#resolution = sys.argv[1] +for resolution in ['c','l','i','h']: + coastlons = []; coastlats = []; coastsegind = []; coastsegtype = [] + coastfile = 'gshhs_'+resolution+'.txt' + countryfile = 'countries_'+resolution+'.txt' + statefile = 'states_'+resolution+'.txt' + riverfile = 'rivers_'+resolution+'.txt' + + poly, polymeta = get_coast_polygons(coastfile) + f = open('../lib/matplotlib/toolkits/basemap/data/gshhs_'+resolution+'.dat','wb') + f2 = open('../lib/matplotlib/toolkits/basemap/data/gshhsmeta_'+resolution+'.dat','w') + offset = 0 + for p,pm in zip(poly,polymeta): + bstring = p.tostring() + f.write(bstring) + typ = pm[0]; area = pm[1]; south = pm[2]; north = pm[3]; npts = pm[4] + f2.write('%s %s %s %9.5f %9.5f %s %s\n' % (typ, area, npts, south, north, offset, len(bstring))) + offset = offset + len(bstring) + f.close() + f2.close() + + poly, polymeta = get_boundary_lines(countryfile) + f = open('../lib/matplotlib/toolkits/basemap/data/countries_'+resolution+'.dat','wb') + f2 = open('../lib/matplotlib/toolkits/basemap/data/countriesmeta_'+resolution+'.dat','w') + offset = 0 + for p,pm in zip(poly,polymeta): + bstring = p.tostring() + f.write(bstring) + south,north,npts = pm[:] + f2.write('%s %s %s %9.5f %9.5f %s %s\n' % (-1,-1,npts, south, north, offset, len(bstring))) + offset = offset + len(bstring) + f.close() + f2.close() + + poly, polymeta = get_boundary_lines(statefile) + f = open('../lib/matplotlib/toolkits/basemap/data/states_'+resolution+'.dat','wb') + f2 = open('../lib/matplotlib/toolkits/basemap/data/statesmeta_'+resolution+'.dat','w') + offset = 0 + for p,pm in zip(poly,polymeta): + bstring = p.tostring() + f.write(bstring) + south,north,npts = pm[:] + f2.write('%s %s %s %9.5f %9.5f %s %s\n' % (-1,-1,npts, south, north, offset, len(bstring))) + offset = offset + len(bstring) + f.close() + f2.close() + + poly, polymeta = get_boundary_lines(riverfile) + f = open('../lib/matplotlib/toolkits/basemap/data/rivers_'+resolution+'.dat','wb') + f2 = open('../lib/matplotlib/toolkits/basemap/data/riversmeta_'+resolution+'.dat','w') + offset = 0 + for p,pm in zip(poly,polymeta): + bstring = p.tostring() + f.write(bstring) + south,north,npts = pm[:] + f2.write('%s %s %s %9.5f %9.5f %s %s\n' % (-1,-1,npts, south, north, offset, len(bstring))) + offset = offset + len(bstring) + f.close() + f2.close() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-12 16:50:20
|
Revision: 4224 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4224&view=rev Author: jswhit Date: 2007-11-12 08:50:16 -0800 (Mon, 12 Nov 2007) Log Message: ----------- include Shapely Modified Paths: -------------- trunk/toolkits/basemap-testing/setup.py Added Paths: ----------- trunk/toolkits/basemap-testing/lib/shapely/ trunk/toolkits/basemap-testing/lib/shapely/__init__.py trunk/toolkits/basemap-testing/lib/shapely/find_geoslib.py Added: trunk/toolkits/basemap-testing/lib/shapely/__init__.py =================================================================== --- trunk/toolkits/basemap-testing/lib/shapely/__init__.py (rev 0) +++ trunk/toolkits/basemap-testing/lib/shapely/__init__.py 2007-11-12 16:50:16 UTC (rev 4224) @@ -0,0 +1 @@ +# Added: trunk/toolkits/basemap-testing/lib/shapely/find_geoslib.py =================================================================== --- trunk/toolkits/basemap-testing/lib/shapely/find_geoslib.py (rev 0) +++ trunk/toolkits/basemap-testing/lib/shapely/find_geoslib.py 2007-11-12 16:50:16 UTC (rev 4224) @@ -0,0 +1,69 @@ +from ctypes import CDLL +from ctypes.util import find_library +import os, sys + +def find_geoslib(): + lgeos = False + # if GEOS_DIR env var set, look there for shared lib. + if os.environ.has_key('GEOS_DIR'): + geos_dir = os.environ['GEOS_DIR'] + from ctypes import CDLL + if sys.platform == 'win32': + try: + lgeos = CDLL(os.path.join(geos_dir,'libgeos_c.dll')) + except (ImportError, WindowsError): + # Try GEOS DLL from the Windows PostGIS installer for + # PostgreSQL 8.2 before failing + try: + lgeos = CDLL(os.path.join(geos_dir,'libgeos_c-1.dll')) + except: + pass + elif sys.platform == 'darwin': + try: + lgeos = CDLL(os.path.join(geos_dir,'libgeos_c.dylib')) + except: + pass + else: + # Try the major versioned name first, falling back on the unversioned name. + try: + lgeos = CDLL(os.path.join(geos_dir,'libgeos_c.so.1')) + except ImportError: + try: + lgeos = CDLL(os.path.join(geos_dir,'libgeos_c.so')) + except: + pass + # if GEOS_DIR env var not set, use find_library to look for shared lib. + else: + if sys.platform == 'win32': + try: + lgeos = find_library('libgeos_c.dll') + except (ImportError, WindowsError): + # Try GEOS DLL from the Windows PostGIS installer for + # PostgreSQL 8.2 before failing + lgeos = find_library('libgeos_c-1.dll') + elif sys.platform == 'darwin': + try: + lgeos = find_library('libgeos_c.dylib') + except: + # fink installs in /sw, but find_library doesn't look there. + lgeos = find_library('/sw/lib/libgeos_c.dylib') + else: + # Try the major versioned name first, falling back on the unversioned name. + try: + lgeos = find_library('libgeos_c.so.1') + except ImportError: + lgeos = find_library('libgeos_c.so') + if not lgeos: + raise ImportError(""" +Cannot find libgeos_c. Please install version 2.2.3. +If it is installed already, please set the GEOS_DIR environment +variable to the location in which it is installed.""") + else: + # lgeos is either a string (containing the absolute + # path to the shared lib) or a CDLL instance. + # convert it to a CDLL instance if it is not one already. + try: + lgeos = CDLL(lgeos) + except: + pass + return lgeos Modified: trunk/toolkits/basemap-testing/setup.py =================================================================== --- trunk/toolkits/basemap-testing/setup.py 2007-11-12 16:31:28 UTC (rev 4223) +++ trunk/toolkits/basemap-testing/setup.py 2007-11-12 16:50:16 UTC (rev 4224) @@ -1,15 +1,8 @@ import sys, glob, os major, minor1, minor2, s, tmp = sys.version_info -if major==2 and minor1<=3: - # setuptools monkeypatches distutils.core.Distribution to support - # package_data - try: import setuptools - except ImportError: - raise SystemExit("""\ -matplotlib requires setuptools for installation. Please download -http://peak.telecommunity.com/dist/ez_setup.py and run it (as su if -you are doing a system wide install) to install the proper version of -setuptools for your system""") +if major==2 and minor1<4: + raise SystemExit(""" +python 2.4 or higher required""") from distutils.core import Extension from distutils.util import convert_path @@ -67,8 +60,33 @@ else: additional_params = {} from distutils.core import setup + +# check for ctypes +try: from ctypes.util import find_library +except ImportError: havectypes = False +else: havectypes = True +if not havectypes: + raise SystemExit(""" +basemap requires ctypes, which comes with python 2.5. If you are +running python 2.4, please install ctypes from +http://pypi.python.org/pypi/ctypes""") + +# check for libgeos_c +sys.path.append('lib/shapely') +from find_geoslib import find_geoslib +lgeos = find_geoslib() +sys.path.remove('lib/shapely') + +# check for shapely +try: import shapely +except ImportError: haveshapely = False +else: haveshapely = True +if not haveshapely: + packages.append('shapely') + packages.append('shapely.geometry') + package_dirs['shapely'] = os.path.join('lib','shapely') + - # Specify all the required mpl data pyproj_datafiles = ['data/epsg', 'data/esri', 'data/esri.extra', 'data/GL27', 'data/nad.lst', 'data/nad27', 'data/nad83', 'data/ntv2_out.dist', 'data/other.extra', 'data/pj_out27.dist', 'data/pj_out83.dist', 'data/proj_def.dat', 'data/README', 'data/td_out.dist', 'data/test27', 'data/test83', 'data/testntv2', 'data/testvarious', 'data/world'] boundaryfiles = [] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 20:52:32
|
Revision: 4251 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4251&view=rev Author: jswhit Date: 2007-11-13 12:52:18 -0800 (Tue, 13 Nov 2007) Log Message: ----------- Add new custom pyrex wrapper of libgeos - Shapely no longer needed. Modified Paths: -------------- trunk/toolkits/basemap-testing/README trunk/toolkits/basemap-testing/setup.py Added Paths: ----------- trunk/toolkits/basemap-testing/src/geos.c trunk/toolkits/basemap-testing/src/geos.pyx Modified: trunk/toolkits/basemap-testing/README =================================================================== --- trunk/toolkits/basemap-testing/README 2007-11-13 20:37:11 UTC (rev 4250) +++ trunk/toolkits/basemap-testing/README 2007-11-13 20:52:18 UTC (rev 4251) @@ -13,10 +13,6 @@ libgoes_c version 2.2.3, available from http://geos.refractions.net/. -ctypes (which comes with python >= 2.5, -but can be installed separately for python 2.4 from -http:/python.org/pypi/ctypes). - **Copyright** source code from proj.4 (http://proj.maptools.org) is included in the @@ -25,10 +21,6 @@ pyshapelib by Bernhard Herzog is included in the 'pyshapelib' directory under the terms given in LICENSE_pyshapelib. -The Shapely module (http://trac.gispython.org/projects/PCL/wiki/Shapely) by -Sean Gillies is included in the 'lib/shapely' directory under the terms -given in LICENSE_shapely. - the coastline, lake, river and political boundary data are extracted from datasets provided with the Generic Mapping Tools (http://gmt.soest.hawaii.edu) @@ -39,7 +31,7 @@ is included. Everything else (including src/_proj.pyx, src/_geod.pyx, src/_pyproj.pxi, -src/_proj.c and src/_geod.c): +src/_proj.c and src/_geod.c, src/_geos.c, src/_geos.pyx): copyright (c) 2007 by Jeffrey Whitaker. Modified: trunk/toolkits/basemap-testing/setup.py =================================================================== --- trunk/toolkits/basemap-testing/setup.py 2007-11-13 20:37:11 UTC (rev 4250) +++ trunk/toolkits/basemap-testing/setup.py 2007-11-13 20:52:18 UTC (rev 4251) @@ -1,10 +1,18 @@ import sys, glob, os major, minor1, minor2, s, tmp = sys.version_info -if major==2 and minor1<4: - raise SystemExit(""" -python 2.4 or higher required""") +if major==2 and minor1<=3: + # setuptools monkeypatches distutils.core.Distribution to support + # package_data + try: import setuptools + except ImportError: + raise SystemExit("""\ +matplotlib requires setuptools for installation. Please download +http://peak.telecommunity.com/dist/ez_setup.py and run it (as su if +you are doing a system wide install) to install the proper version of +setuptools for your system""") from distutils.core import Extension from distutils.util import convert_path +import numpy def dbf_macros(): """Return the macros to define when compiling the dbflib wrapper. @@ -23,14 +31,22 @@ else: return [("HAVE_UPDATE_HEADER", "0")] +GEOS_dir = os.environ.get('GEOS_DIR') +if GEOS_dir is None: + raise KeyError, 'please specify the location of geos library and headers with GEOS_DIR environment variable' +geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()] +geos_library_dirs=[os.path.join(GEOS_dir,'lib')] + deps = glob.glob('src/*.c') deps.remove(os.path.join('src','_proj.c')) deps.remove(os.path.join('src','_geod.c')) +deps.remove(os.path.join('src','geos.c')) packages = ['matplotlib.toolkits.basemap'] package_dirs = {'':'lib'} extensions = [Extension("matplotlib.toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)] extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) +extensions.append(Extension("matplotlib.toolkits.basemap.geos",deps+['src/geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,runtime_library_dirs=geos_library_dirs,libraries=['geos_c'])) # install shapelib and dbflib. packages = packages + ['shapelib','dbflib'] @@ -61,32 +77,6 @@ additional_params = {} from distutils.core import setup -# check for ctypes -try: from ctypes.util import find_library -except ImportError: havectypes = False -else: havectypes = True -if not havectypes: - raise SystemExit(""" -basemap requires ctypes, which comes with python 2.5. If you are -running python 2.4, please install ctypes from -http://pypi.python.org/pypi/ctypes""") - -# check for libgeos_c -sys.path.append('lib/shapely') -from find_geoslib import find_geoslib -lgeos = find_geoslib() -sys.path.remove('lib/shapely') - -# check for shapely -try: import shapely -except ImportError: haveshapely = False -else: haveshapely = True -if not haveshapely: - packages.append('shapely') - packages.append('shapely.geometry') - package_dirs['shapely'] = os.path.join('lib','shapely') - - # Specify all the required mpl data pyproj_datafiles = ['data/epsg', 'data/esri', 'data/esri.extra', 'data/GL27', 'data/nad.lst', 'data/nad27', 'data/nad83', 'data/ntv2_out.dist', 'data/other.extra', 'data/pj_out27.dist', 'data/pj_out83.dist', 'data/proj_def.dat', 'data/README', 'data/td_out.dist', 'data/test27', 'data/test83', 'data/testntv2', 'data/testvarious', 'data/world'] boundaryfiles = [] Added: trunk/toolkits/basemap-testing/src/geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/geos.c (rev 0) +++ trunk/toolkits/basemap-testing/src/geos.c 2007-11-13 20:52:18 UTC (rev 4251) @@ -0,0 +1,3104 @@ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 13:39:59 2007 */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#include "structmember.h" +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) + #define PyNumber_Index(o) PyNumber_Int(o) + #define PyIndex_Check(o) PyNumber_Check(o) +#endif +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" +#else +#define __PYX_EXTERN_C extern +#endif +__PYX_EXTERN_C double pow(double, double); +#include "numpy/arrayobject.h" +#include "geos_c.h" + + +#ifdef __GNUC__ +#define INLINE __inline__ +#elif _WIN32 +#define INLINE __inline +#else +#define INLINE +#endif + +typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/ + +#define __pyx_PyIndex_AsSsize_t(b) PyInt_AsSsize_t(PyNumber_Index(b)) + +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + if (x == Py_True) return 1; + else if (x == Py_False) return 0; + else return PyObject_IsTrue(x); +} + + +#ifdef __GNUC__ +/* Test for GCC > 2.95 */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#else /* __GNUC__ > 2 ... */ +#define likely(x) (x) +#define unlikely(x) (x) +#endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ +#define likely(x) (x) +#define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static int __pyx_lineno; +static char *__pyx_filename; +static char **__pyx_f; + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ + +static PyObject *__Pyx_GetExcValue(void); /*proto*/ + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static void __Pyx_WriteUnraisable(char *name); /*proto*/ + +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ + +static void __Pyx_AddTraceback(char *funcname); /*proto*/ + +/* Declarations from geos */ + + +struct __pyx_obj_4geos_BaseGeometry { + PyObject_HEAD + GEOSGeom (*_geom); + unsigned int _npts; +}; + + +struct __pyx_obj_4geos_Polygon { + struct __pyx_obj_4geos_BaseGeometry __pyx_base; +}; + + +struct __pyx_obj_4geos_LineString { + struct __pyx_obj_4geos_BaseGeometry __pyx_base; +}; + + +struct __pyx_obj_4geos_Point { + struct __pyx_obj_4geos_BaseGeometry __pyx_base; + PyObject *x; + PyObject *y; +}; + +static PyTypeObject *__pyx_ptype_4geos_ndarray = 0; +static PyTypeObject *__pyx_ptype_4geos_BaseGeometry = 0; +static PyTypeObject *__pyx_ptype_4geos_Polygon = 0; +static PyTypeObject *__pyx_ptype_4geos_LineString = 0; +static PyTypeObject *__pyx_ptype_4geos_Point = 0; +static PyArrayObject *__pyx_k4; +static PyArrayObject *__pyx_k5; +static PyObject *__pyx_k6; +static void (__pyx_f_4geos_notice_h(char (*),char (*))); /*proto*/ +static void (__pyx_f_4geos_error_h(char (*),char (*))); /*proto*/ +static PyObject *(__pyx_f_4geos__add_geom(struct __pyx_obj_4geos_BaseGeometry *,GEOSGeom (*))); /*proto*/ +static PyObject *(__pyx_f_4geos__get_coords(GEOSGeom (*))); /*proto*/ + + +/* Implementation of geos */ + +static char (__pyx_k3[]) = "0.1"; + +static PyObject *__pyx_n_sys; +static PyObject *__pyx_n_numpy; +static PyObject *__pyx_n___version__; +static PyObject *__pyx_n_is_valid; +static PyObject *__pyx_n_geom_type; +static PyObject *__pyx_n_within; +static PyObject *__pyx_n_intersects; +static PyObject *__pyx_n_intersection; +static PyObject *__pyx_n_get_coords; +static PyObject *__pyx_n___init__; +static PyObject *__pyx_n_area; + +static PyObject *__pyx_k3p; + +static PyObject *__pyx_n_stdout; +static PyObject *__pyx_n_write; + +static PyObject *__pyx_k7p; + +static char (__pyx_k7[]) = "GEOS_NOTICE: %s\n"; + +static void __pyx_f_4geos_notice_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { + PyObject *__pyx_v_format; + PyObject *__pyx_v_message; + PyObject *__pyx_v_warn_msg; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + __pyx_v_format = Py_None; Py_INCREF(Py_None); + __pyx_v_message = Py_None; Py_INCREF(Py_None); + __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":99 + * + * cdef void notice_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) # <<<<<<<<<<<<<< + * message = PyString_FromString(msg) + * try: + */ + __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":100 + * cdef void notice_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) # <<<<<<<<<<<<<< + * try: + * warn_msg = format % message + */ + __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":101 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":102 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L2;} + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_1; + __pyx_1 = 0; + } + goto __pyx_L3; + __pyx_L2:; + Py_XDECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":103 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("geos.notice_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":104 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":105 + * except: + * warn_msg = format + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) # <<<<<<<<<<<<<< + * + * cdef void error_h(char *fmt, char*msg): + */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_WriteUnraisable("geos.notice_h"); + __pyx_L0:; + Py_DECREF(__pyx_v_format); + Py_DECREF(__pyx_v_message); + Py_DECREF(__pyx_v_warn_msg); +} + +static PyObject *__pyx_n_stderr; + +static PyObject *__pyx_k8p; + +static char (__pyx_k8[]) = "GEOS_ERROR: %s\n"; + +static void __pyx_f_4geos_error_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { + PyObject *__pyx_v_format; + PyObject *__pyx_v_message; + PyObject *__pyx_v_warn_msg; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + __pyx_v_format = Py_None; Py_INCREF(Py_None); + __pyx_v_message = Py_None; Py_INCREF(Py_None); + __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":108 + * + * cdef void error_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) # <<<<<<<<<<<<<< + * message = PyString_FromString(msg) + * try: + */ + __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":109 + * cdef void error_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) # <<<<<<<<<<<<<< + * try: + * warn_msg = format % message + */ + __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":110 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":111 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L2;} + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_1; + __pyx_1 = 0; + } + goto __pyx_L3; + __pyx_L2:; + Py_XDECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":112 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("geos.error_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":113 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":114 + * except: + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<< + * + * # The initGEOS routine should be called first, however, that routine takes + */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_WriteUnraisable("geos.error_h"); + __pyx_L0:; + Py_DECREF(__pyx_v_format); + Py_DECREF(__pyx_v_message); + Py_DECREF(__pyx_v_warn_msg); +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused) { + char __pyx_v_valid; + PyObject *__pyx_r; + char __pyx_1; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":129 + * def is_valid(self): + * cdef char valid + * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<< + * if valid: + * return True + */ + __pyx_v_valid = GEOSisValid(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":130 + * cdef char valid + * valid = GEOSisValid(self._geom) + * if valid: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_valid; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":131 + * valid = GEOSisValid(self._geom) + * if valid: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":133 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def geom_type(self): + */ + Py_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":136 + * + * def geom_type(self): + * return PyString_FromString(GEOSGeomType(self._geom)) # <<<<<<<<<<<<<< + * + * def within(self, BaseGeometry geom): + */ + __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("geos.BaseGeometry.geom_type"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { + GEOSGeom (*__pyx_v_g1); + GEOSGeom (*__pyx_v_g2); + char __pyx_v_answer; + PyObject *__pyx_r; + char __pyx_1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_geom); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":141 + * cdef GEOSGeom *g1, *g2 + * cdef char answer + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":142 + * cdef char answer + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * answer = GEOSWithin(g1, g2) + * if answer: + */ + __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":143 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSWithin(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":144 + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":145 + * answer = GEOSWithin(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":147 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersects(self, BaseGeometry geom): + */ + Py_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + __Pyx_AddTraceback("geos.BaseGeometry.within"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { + GEOSGeom (*__pyx_v_g1); + GEOSGeom (*__pyx_v_g2); + char __pyx_v_answer; + PyObject *__pyx_r; + char __pyx_1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_geom); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":152 + * cdef GEOSGeom *g1, *g2 + * cdef char answer + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":153 + * cdef char answer + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * answer = GEOSIntersects(g1, g2) + * if answer: + */ + __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":154 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSIntersects(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":155 + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":156 + * answer = GEOSIntersects(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":158 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersection(self, BaseGeometry geom): + */ + Py_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + __Pyx_AddTraceback("geos.BaseGeometry.intersects"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_n_append; +static PyObject *__pyx_n_NotImplementedError; + +static PyObject *__pyx_k9p; + +static PyObject *__pyx_builtin_NotImplementedError; + +static char (__pyx_k9[]) = "intersections of type '%s' not yet implemented"; + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { + GEOSGeom (*__pyx_v_g1); + GEOSGeom (*__pyx_v_g2); + GEOSGeom (*__pyx_v_g3); + GEOSGeom (*__pyx_v_gout); + int __pyx_v_numgeoms; + int __pyx_v_i; + int __pyx_v_typeid; + PyObject *__pyx_v_p; + PyObject *__pyx_v_pout; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_geom); + __pyx_v_p = Py_None; Py_INCREF(Py_None); + __pyx_v_pout = Py_None; Py_INCREF(Py_None); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_4geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":164 + * cdef char answer + * cdef int numgeoms, i, typeid + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":165 + * cdef int numgeoms, i, typeid + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) + */ + __pyx_v_g2 = ((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":166 + * g1 = self._geom + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) # <<<<<<<<<<<<<< + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + */ + __pyx_v_g3 = GEOSIntersection(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":167 + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + */ + __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":168 + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. + */ + __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":169 + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) # add geometry to it. + * # above should be faster than this .. + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":170 + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< + * # above should be faster than this .. + * #b = _get_coords(g3) + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":174 + * #b = _get_coords(g3) + * #p = Polygon(b) + * pout = [p] # return a list with a single element # <<<<<<<<<<<<<< + * elif typeid == GEOS_LINESTRING: + * p = LineString() + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":176 + * pout = [p] # return a list with a single element + * elif typeid == GEOS_LINESTRING: + * p = LineString() # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) + * return [p] + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":177 + * elif typeid == GEOS_LINESTRING: + * p = LineString() + * p = _add_geom(p,g3) # <<<<<<<<<<<<<< + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":178 + * p = LineString() + * p = _add_geom(p,g3) + * return [p] # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":180 + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":181 + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":182 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":183 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":184 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":185 + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + __pyx_2 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":186 + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":188 + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":189 + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":190 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an empty Polygon instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":191 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = LineString() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":192 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_3; + __pyx_3 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":193 + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * else: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_4geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + __pyx_4 = __pyx_f_4geos__add_geom(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_4; + __pyx_4 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":194 + * p = LineString() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":196 + * pout.append(p) + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< + * return pout + * + */ + __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":197 + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * return pout # <<<<<<<<<<<<<< + * + * def get_coords(self): + */ + Py_INCREF(__pyx_v_pout); + __pyx_r = __pyx_v_pout; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_AddTraceback("geos.BaseGeometry.intersection"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_p); + Py_DECREF(__pyx_v_pout); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":200 + * + * def get_coords(self): + * return _get_coords(self._geom) # <<<<<<<<<<<<<< + * + * cdef class Polygon(BaseGeometry): + */ + __pyx_1 = __pyx_f_4geos__get_coords(((struct __pyx_obj_4geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("geos.BaseGeometry.get_coords"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_num_neg_1; +static PyObject *__pyx_num_0; +static PyObject *__pyx_num_1; + +static PyObject *__pyx_n_copy; +static PyObject *__pyx_n_shape; + +static int __pyx_f_py_4geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_py_4geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_b = 0; + unsigned int __pyx_v_M; + unsigned int __pyx_v_m; + unsigned int __pyx_v_i; + double __pyx_v_dx; + double __pyx_v_dy; + double (*__pyx_v_bbuffer); + GEOSCoordSeq (*__pyx_v_cs); + GEOSGeom (*__pyx_v_lr); + int __pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + unsigned int __pyx_5; + PyObject *__pyx_6 = 0; + static char *__pyx_argnames[] = {"b",0}; + __pyx_v_b = __pyx_k4; + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_b))) return -1; + Py_INCREF((PyObject *)__pyx_v_self); + Py_INCREF(__pyx_v_b); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_4geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":214 + * + * # just return an empty class + * if b is None: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_1 = (((PyObject *)__pyx_v_b) == Py_None); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":215 + * # just return an empty class + * if b is None: + * return # <<<<<<<<<<<<<< + * + * # make sure data is contiguous. + */ + __pyx_r = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":219 + * # make sure data is contiguous. + * # if not, make a local copy. + * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<< + * b = b.copy() + * + */ + __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b)); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":220 + * # if not, make a local copy. + * if not PyArray_ISCONTIGUOUS(b): + * b = b.copy() # <<<<<<<<<<<<<< + * + * m = b.shape[0] + */ + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_b)); + __pyx_v_b = ((PyArrayObject *)__pyx_3); + __pyx_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":222 + * b = b.copy() + * + * m = b.shape[0] # <<<<<<<<<<<<<< + * + * # Add closing coordinates to sequence? + */ + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} + if (PyList_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_2)) { + __pyx_4 = PyList_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4); + } else if (PyTuple_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_2)) { + __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4); + } else { + __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + } + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_m = __pyx_5; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":225 + * + * # Add closing coordinates to sequence? + * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: # <<<<<<<<<<<<<< + * M = m + 1 + * else: + */ + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_INCREF(__pyx_num_neg_1); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1); + Py_INCREF(__pyx_num_0); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0); + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_INCREF(__pyx_num_0); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_0); + Py_INCREF(__pyx_num_0); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0); + __pyx_6 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_6, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + if (!__pyx_1) { + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_INCREF(__pyx_num_neg_1); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1); + Py_INCREF(__pyx_num_1); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_1); + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_INCREF(__pyx_num_0); + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_num_0); + Py_INCREF(__pyx_num_1); + PyTuple_SET_ITEM(__pyx_6, 1, __pyx_num_1); + __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + } + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":226 + * # Add closing coordinates to sequence? + * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: + * M = m + 1 # <<<<<<<<<<<<<< + * else: + * M = m + */ + __pyx_v_M = (__pyx_v_m + 1); + goto __pyx_L4; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":228 + * M = m + 1 + * else: + * M = m # <<<<<<<<<<<<<< + * self._npts = M + * + */ + __pyx_v_M = __pyx_v_m; + } + __pyx_L4:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":229 + * else: + * M = m + * self._npts = M # <<<<<<<<<<<<<< + * + * # Create a coordinate sequence + */ + ((struct __pyx_obj_4geos_Polygon *)__pyx_v_self)->__pyx_base._npts = __pyx_v_M; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":232 + * + * # Create a coordinate sequence + * cs = GEOSCoordSeq_create(M, 2) # <<<<<<<<<<<<<< + * + * # add to coordinate sequence + */ + __pyx_v_cs = GEOSCoordSeq_create(__pyx_v_M,2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":235 + * + * # add to coordinate sequence + * bbuffer = <double *>b.data # <<<<<<<<<<<<<< + * for i from 0 <= i < m: + * dx = bbuffer[2*i] + */ + __pyx_v_bbuffer = ((double (*))__pyx_v_b->data); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":236 + * # add to coordinate sequence + * bbuffer = <double *>b.data + * for i from 0 <= i < m: # <<<<<<<<<<<<<< + * dx = bbuffer[2*i] + * dy = bbuffer[2*i+1] + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_m; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":237 + * bbuffer = <double *>b.data + * for i from 0 <= i < m: + * dx = bbuffer[2*i] # <<<<<<<<<<<<<< + * dy = bbuffer[2*i+1] + * # Because of a bug in the GEOS C API, + */ + __pyx_v_dx = (__pyx_v_bbuffer[(2 * __pyx_v_i)]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":238 + * for i from 0 <= i < m: + * dx = bbuffer[2*i] + * dy = bbuffer[2*i+1] # <<<<<<<<<<<<<< + * # Because of a bug in the GEOS C API, + * # always set X before Y + */ + __pyx_v_dy = (__pyx_v_bbuffer[((2 * __pyx_v_i) + 1)]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":241 + * # Because of a bug in the GEOS C API, + * # always set X before Y + * GEOSCoordSeq_setX(cs, i, dx) # <<<<<<<<<<<<<< + * GEOSCoordSeq_setY(cs, i, dy) + * + */ + GEOSCoordSeq_setX(__pyx_v_cs,__pyx_v_i,__pyx_v_dx); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":242 + * # always set X before Y + * GEOSCoordSeq_setX(cs, i, dx) + * GEOSCoordSeq_setY(cs, i, dy) # <<<<<<<<<<<<<< + * + * # Add closing coordinates to sequence? + */ + GEOSCoordSeq_setY(__pyx_v_cs,__pyx_v_i,__pyx_v_dy); + } + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":245 + * + * # Add closing coordinates to sequence? + * if M > m: # <<<<<<<<<<<<<< + * dx = bbuffer[0] + * dy = bbuffer[1] + */ + __pyx_1 = (__pyx_v_M > __pyx_v_m); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":246 + * # Add closing coordinates to sequence? + * if M > m: + * dx = bbuffer[0] # <<<<<<<<<<<<<< + * dy = bbuffer[1] + * GEOSCoordSeq_setX(cs, M-1, dx) + */ + __pyx_v_dx = (__pyx_v_bbuffer[0]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":247 + * if M > m: + * dx = bbuffer[0] + * dy = bbuffer[1] # <<<<<<<<<<<<<< + * GEOSCoordSeq_setX(cs, M-1, dx) + * GEOSCoordSeq_setY(cs, M-1, dy) + */ + __pyx_v_dy = (__pyx_v_bbuffer[1]); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":248 + * dx = bbuffer[0] + * dy = bbuffer[1] + * GEOSCoordSeq_setX(cs, M-1, dx) # <<<<<<<<<<<<<< + * GEOSCoordSeq_setY(cs, M-1, dy) + * + */ + GEOSCoordSeq_setX(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dx); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":249 + * dy = bbuffer[1] + * GEOSCoordSeq_setX(cs, M-1, dx) + * GEOSCoordSeq_setY(cs, M-1, dy) # <<<<<<<<<<<<<< + * + * # create LinearRing + */ + GEOSCoordSeq_setY(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dy); + goto __pyx_L7; + } + __pyx_L7:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":252 + * + * # create LinearRing + * lr = GEOSGeom_createLinearRing(cs) # <<<<<<<<<<<<<< + * + * # create Polygon from LinearRing (assuming no holes) + */ + __pyx_v_lr = GEOSGeom_createLinearRing(__pyx_v_cs); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":255 + * + * # create Polygon from LinearRing (assuming no holes) + * self._geom = GEOSGeom_createPolygon(lr,NULL,0) # <<<<<<<<<<<<<< + * + * def area(self): + */ + ((struct __pyx_obj_4geos_Polygon *)__pyx_v_self)->__pyx_base._geom = GEOSGeom_createPolygon(__pyx_v_lr,NULL,0); + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_6); + __Pyx_AddTraceback("geos.Polygon.__init__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF((PyObject *)__pyx_v_self); + Py_DECREF(__pyx_v_b); + return __pyx_r; +} + +static PyObject *__pyx_f_py_4geos_7Polygon_area(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_4geos_7Polygon_area(PyObject *__pyx_v_self, PyObject *unused) { + double __pyx_v_area; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF((PyObject *)__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/geos.pyx":259 + * def area(self): + * cdef double area + * GEOS... [truncated message content] |
From: <js...@us...> - 2007-11-13 20:53:07
|
Revision: 4252 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4252&view=rev Author: jswhit Date: 2007-11-13 12:52:54 -0800 (Tue, 13 Nov 2007) Log Message: ----------- obsolete Removed Paths: ------------- trunk/toolkits/basemap-testing/LICENSE_shapely trunk/toolkits/basemap-testing/lib/shapely/ Deleted: trunk/toolkits/basemap-testing/LICENSE_shapely =================================================================== --- trunk/toolkits/basemap-testing/LICENSE_shapely 2007-11-13 20:52:18 UTC (rev 4251) +++ trunk/toolkits/basemap-testing/LICENSE_shapely 2007-11-13 20:52:54 UTC (rev 4252) @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-13 22:23:35
|
Revision: 4257 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4257&view=rev Author: jswhit Date: 2007-11-13 14:23:33 -0800 (Tue, 13 Nov 2007) Log Message: ----------- fixes so Basemap instance can be pickled again Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py trunk/toolkits/basemap-testing/setup.py Added Paths: ----------- trunk/toolkits/basemap-testing/src/_geos.c trunk/toolkits/basemap-testing/src/_geos.pyx Removed Paths: ------------- trunk/toolkits/basemap-testing/src/geos.c trunk/toolkits/basemap-testing/src/geos.pyx Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 21:29:33 UTC (rev 4256) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 22:23:33 UTC (rev 4257) @@ -14,9 +14,7 @@ from numpy import linspace, squeeze, ma from matplotlib.cbook import popd, is_scalar from shapelib import ShapeFile -from geos import Polygon as PolygonShape -from geos import LineString as LineShape -from geos import Point as PointShape +import _geos # basemap data files now installed in lib/matplotlib/toolkits/basemap/data basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data']) @@ -31,7 +29,7 @@ transverse mercator, miller cylindrical, lambert conformal conic, azimuthal equidistant, equidistant conic, lambert azimuthal equal area, albers equal area conic, gnomonic, orthographic, sinusoidal, mollweide, - geostationary, robinson, cassini-soldner or stereographic). + _geostationary, robinson, cassini-soldner or stereographic). Doesn't actually draw anything, but sets up the map projection class and creates the coastline, lake river and political boundary data structures in native map projection coordinates. @@ -42,7 +40,7 @@ projection - map projection ('cyl','merc','mill','lcc','eqdc','aea', 'laea', 'nplaea', 'splaea', 'tmerc', 'omerc', 'cass', 'gnom', 'poly', 'sinu', 'moll', 'ortho', 'robin', 'aeqd', 'npaeqd', 'spaeqd', 'stere', - 'geos', 'npstere' or 'spstere') + '_geos', 'npstere' or 'spstere') (projections prefixed with 'np' or 'sp' are special case polar-centric versions of the parent projection) aspect - map aspect ratio (size of y dimension / size of x dimension). @@ -112,7 +110,7 @@ 'cass' - cassini-soldner (transverse cylindrical equidistant), 'poly' - polyconic, 'omerc' - oblique mercator, 'ortho' - orthographic, 'sinu' - sinusoidal, 'moll' - mollweide, 'robin' - robinson, - 'geos' - geostationary, and 'gnom' - gnomonic are currently available. + '_geos' - _geostationary, and 'gnom' - gnomonic are currently available. Default is 'cyl'. The map projection region can either be specified by setting these keywords: @@ -135,9 +133,9 @@ either they are computed internally, or entire globe is always plotted). For the cylindrical projections ('cyl','merc' and 'mill'), the default is to use llcrnrlon=-180,llcrnrlat=-90, urcrnrlon=180 and urcrnrlat=90). For all other - projections except 'ortho' and 'geos', either the lat/lon values of the + projections except 'ortho' and '_geos', either the lat/lon values of the corners or width and height must be specified by the user. - For 'ortho' and 'geos', the lat/lon values of the corners may be specified, + For 'ortho' and '_geos', the lat/lon values of the corners may be specified, but if they are not, the entire globe is plotted. resolution - resolution of boundary database to use. Can be 'c' (crude), @@ -210,7 +208,7 @@ on the north or south pole. The longitude lon_0 is at 6-o'clock, and the latitude circle boundinglat is tangent to the edge of the map at lon_0. satellite_height - height of satellite (in m) above equator - - only relevant for geostationary projections ('geos'). + only relevant for _geostationary projections ('_geos'). """ @@ -504,7 +502,7 @@ # FIXME: won't work for points exactly on equator?? if npy.abs(lat_0) < 1.e-2: lat_0 = 1.e-2 projparams['lat_0'] = lat_0 - elif projection == 'geos': + elif projection == '_geos': if lon_0 is None and satellite_height is None: raise ValueError, 'must specify lon_0 and satellite_height for Geostationary basemap' if width is not None or height is not None: @@ -593,7 +591,7 @@ 'splaea' - lambert azimuthal, special case centered on south pole, 'cass' - cassini-soldner (transverse cylindrical equidistant), 'poly' - polyconic, 'omerc' - oblique mercator, 'ortho' - orthographic, - 'geos' - geostationary, 'sinu' - sinusoidal, 'moll' - mollweide, + '_geos' - _geostationary, 'sinu' - sinusoidal, 'moll' - mollweide, 'robin' - robinson, or 'gnom' - gnomonic. You tried '%s'""" % projection # initialize proj4 @@ -608,7 +606,7 @@ atts = ['rmajor','rminor','esq','flattening','ellipsoid','projparams'] for att in atts: self.__dict__[att] = proj.__dict__[att] - # these only exist for geostationary projection. + # these only exist for _geostationary projection. if hasattr(proj,'_width'): self.__dict__['_width'] = proj.__dict__['_width'] if hasattr(proj,'_height'): @@ -647,7 +645,7 @@ if projection in ['mill','cyl','merc']: self.latmin = self.llcrnrlat self.latmax = self.urcrnrlat - elif projection in ['ortho','geos','moll','robin','sinu']: + elif projection in ['ortho','_geos','moll','robin','sinu']: self.latmin = -90. self.latmax = 90. else: @@ -748,12 +746,12 @@ polygon_types = [] # coastlines are polygons, other boundaries are line segments. if name == 'gshhs': - Shape = PolygonShape + Shape = _geos.Polygon else: - Shape = LineShape + Shape = _geos.LineString # see if map projection region polygon contains a pole. - NPole = PointShape(self(0.,90.)) - SPole = PointShape(self(0.,-90.)) + NPole = _geos.Point(self(0.,90.)) + SPole = _geos.Point(self(0.,-90.)) boundarypolyxy = self._boundarypolyxy boundarypolyll = self._boundarypolyll hasNP = NPole.within(boundarypolyxy) @@ -761,7 +759,7 @@ containsPole = hasNP or hasSP # these projections cannot cross pole. if containsPole and\ - self.projection in ['tmerc','cass','omerc','merc','mill','cyl','robin','moll','sinu','geos']: + self.projection in ['tmerc','cass','omerc','merc','mill','cyl','robin','moll','sinu','_geos']: raise ValueError('%s projection cannot cross pole'%(self.projection)) # make sure orthographic projection has containsPole=True @@ -777,7 +775,7 @@ b = self._boundarypolyll.get_coords() blons = b[:,0]; blats = b[:,1] b[:,0], b[:,1] = maptran(blons, blats) - boundarypolyxy = PolygonShape(b) + boundarypolyxy = _geos.Polygon(b) for line in bdatmetafile: linesplit = line.split() area = float(linesplit[1]) @@ -824,7 +822,7 @@ lats.append(-90.) b = npy.empty((len(lons),2),npy.float64) b[:,0] = lons; b[:,1] = lats - poly = PolygonShape(b) + poly = _geos.Polygon(b) antart = True else: poly = Shape(b) @@ -934,7 +932,7 @@ nx = 100 ny = 100 maptran = self - if self.projection in ['ortho','geos']: + if self.projection in ['ortho','_geos']: # circular region. thetas = linspace(0.,2.*npy.pi,2*nx*ny)[:-1] if self.projection == 'ortho': @@ -947,7 +945,7 @@ y = rminor*npy.sin(thetas) + rminor b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = PolygonShape(b) + boundaryxy = _geos.Polygon(b) # compute proj instance for full disk, if necessary. if not self._fulldisk: projparms = self.projparams @@ -986,7 +984,7 @@ x, y = maptran(lons,lats) b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = PolygonShape(b) + boundaryxy = _geos.Polygon(b) else: # all other projections are rectangular. # left side (x = xmin, ymin <= y <= ymax) yy = linspace(self.ymin, self.ymax, ny)[:-1] @@ -1007,7 +1005,7 @@ b = npy.empty((4,2),npy.float64) b[:,0]=[self.xmin,self.xmin,self.xmax,self.xmax] b[:,1]=[self.ymin,self.ymax,self.ymax,self.ymin] - boundaryxy = PolygonShape(b) + boundaryxy = _geos.Polygon(b) if self.projection in ['mill','merc','cyl']: # make sure map boundary doesn't quite include pole. if self.urcrnrlat > 89.9999: @@ -1023,7 +1021,7 @@ x, y = self(lons, lats) b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = PolygonShape(b) + boundaryxy = _geos.Polygon(b) else: if self.projection not in ['moll','robin','sinu']: lons, lats = maptran(x,y,inverse=True) @@ -1041,7 +1039,7 @@ n = n + 1 b = npy.empty((len(lons),2),npy.float64) b[:,0]=lons; b[:,1]=lats - boundaryll = PolygonShape(b) + boundaryll = _geos.Polygon(b) return boundaryll, boundaryxy @@ -1067,7 +1065,7 @@ circle.set_edgecolor(color) circle.set_linewidth(linewidth) circle.set_clip_on(False) - elif self.projection == 'geos' and self._fulldisk: # elliptical region + elif self.projection == '_geos' and self._fulldisk: # elliptical region # define an Ellipse patch, add it to axes instance. ellps = Ellipse((self._width,self._height),2.*self._width,2.*self._height) ax.add_patch(ellps) @@ -1509,8 +1507,8 @@ l.set_zorder(zorder) ax.add_line(l) # draw labels for parallels - # parallels not labelled for fulldisk orthographic or geostationary - if self.projection in ['ortho','geos'] and max(labels): + # parallels not labelled for fulldisk orthographic or _geostationary + if self.projection in ['ortho','_geos'] and max(labels): if self._fulldisk: print 'Warning: Cannot label parallels on full-disk Orthographic or Geostationary basemap' labels = [0,0,0,0] @@ -1716,11 +1714,11 @@ ax.add_line(l) # draw labels for meridians. # meridians not labelled for sinusoidal, mollweide, or - # or full-disk orthographic/geostationary. + # or full-disk orthographic/_geostationary. if self.projection in ['sinu','moll'] and max(labels): print 'Warning: Cannot label meridians on Sinusoidal or Mollweide basemap' labels = [0,0,0,0] - if self.projection in ['ortho','geos'] and max(labels): + if self.projection in ['ortho','_geos'] and max(labels): if self._fulldisk: print 'Warning: Cannot label meridians on full-disk Geostationary or Orthographic basemap' labels = [0,0,0,0] @@ -2074,7 +2072,7 @@ # turn off axes frame for non-rectangular projections. if self.projection in ['moll','robin','sinu']: ax.set_frame_on(False) - if self.projection in ['ortho','geos'] and self._fulldisk: + if self.projection in ['ortho','_geos'] and self._fulldisk: ax.set_frame_on(False) # make sure aspect ratio of map preserved. # plot is re-centered in bounding rectangle. Modified: trunk/toolkits/basemap-testing/setup.py =================================================================== --- trunk/toolkits/basemap-testing/setup.py 2007-11-13 21:29:33 UTC (rev 4256) +++ trunk/toolkits/basemap-testing/setup.py 2007-11-13 22:23:33 UTC (rev 4257) @@ -37,16 +37,19 @@ geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()] geos_library_dirs=[os.path.join(GEOS_dir,'lib')] +# proj4 and geos extensions. deps = glob.glob('src/*.c') deps.remove(os.path.join('src','_proj.c')) deps.remove(os.path.join('src','_geod.c')) -deps.remove(os.path.join('src','geos.c')) +deps.remove(os.path.join('src','_geos.c')) packages = ['matplotlib.toolkits.basemap'] package_dirs = {'':'lib'} extensions = [Extension("matplotlib.toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)] extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) -extensions.append(Extension("matplotlib.toolkits.basemap.geos",deps+['src/geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,runtime_library_dirs=geos_library_dirs,libraries=['geos_c'])) +# for some reason, pickling won't work if this extension is installed +# as "matplotlib.toolkits.basemap._geos" +extensions.append(Extension("_geos",deps+['src/_geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,runtime_library_dirs=geos_library_dirs,libraries=['geos_c'])) # install shapelib and dbflib. packages = packages + ['shapelib','dbflib'] Added: trunk/toolkits/basemap-testing/src/_geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/_geos.c (rev 0) +++ trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 22:23:33 UTC (rev 4257) @@ -0,0 +1,3230 @@ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 15:19:22 2007 */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#include "structmember.h" +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) + #define PyNumber_Index(o) PyNumber_Int(o) + #define PyIndex_Check(o) PyNumber_Check(o) +#endif +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" +#else +#define __PYX_EXTERN_C extern +#endif +__PYX_EXTERN_C double pow(double, double); +#include "numpy/arrayobject.h" +#include "geos_c.h" + + +#ifdef __GNUC__ +#define INLINE __inline__ +#elif _WIN32 +#define INLINE __inline +#else +#define INLINE +#endif + +typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/ + +#define __pyx_PyIndex_AsSsize_t(b) PyInt_AsSsize_t(PyNumber_Index(b)) + +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + if (x == Py_True) return 1; + else if (x == Py_False) return 0; + else return PyObject_IsTrue(x); +} + + +#ifdef __GNUC__ +/* Test for GCC > 2.95 */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#else /* __GNUC__ > 2 ... */ +#define likely(x) (x) +#define unlikely(x) (x) +#endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ +#define likely(x) (x) +#define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static int __pyx_lineno; +static char *__pyx_filename; +static char **__pyx_f; + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ + +static PyObject *__Pyx_GetExcValue(void); /*proto*/ + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static void __Pyx_WriteUnraisable(char *name); /*proto*/ + +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ + +static void __Pyx_AddTraceback(char *funcname); /*proto*/ + +/* Declarations from _geos */ + + +struct __pyx_obj_5_geos_BaseGeometry { + PyObject_HEAD + GEOSGeom (*_geom); + unsigned int _npts; + PyObject *boundary; +}; + + +struct __pyx_obj_5_geos_Polygon { + struct __pyx_obj_5_geos_BaseGeometry __pyx_base; +}; + + +struct __pyx_obj_5_geos_LineString { + struct __pyx_obj_5_geos_BaseGeometry __pyx_base; +}; + + +struct __pyx_obj_5_geos_Point { + struct __pyx_obj_5_geos_BaseGeometry __pyx_base; + PyObject *x; + PyObject *y; +}; + +static PyTypeObject *__pyx_ptype_5_geos_ndarray = 0; +static PyTypeObject *__pyx_ptype_5_geos_BaseGeometry = 0; +static PyTypeObject *__pyx_ptype_5_geos_Polygon = 0; +static PyTypeObject *__pyx_ptype_5_geos_LineString = 0; +static PyTypeObject *__pyx_ptype_5_geos_Point = 0; +static PyArrayObject *__pyx_k4; +static PyArrayObject *__pyx_k5; +static PyObject *__pyx_k6; +static void (__pyx_f_5_geos_notice_h(char (*),char (*))); /*proto*/ +static void (__pyx_f_5_geos_error_h(char (*),char (*))); /*proto*/ +static PyObject *(__pyx_f_5_geos__add_geom(struct __pyx_obj_5_geos_BaseGeometry *,GEOSGeom (*))); /*proto*/ +static PyObject *(__pyx_f_5_geos__get_coords(GEOSGeom (*))); /*proto*/ + + +/* Implementation of _geos */ + +static char (__pyx_k3[]) = "0.1"; + +static PyObject *__pyx_n_sys; +static PyObject *__pyx_n_numpy; +static PyObject *__pyx_n___version__; +static PyObject *__pyx_n_is_valid; +static PyObject *__pyx_n_geom_type; +static PyObject *__pyx_n_within; +static PyObject *__pyx_n_intersects; +static PyObject *__pyx_n_intersection; +static PyObject *__pyx_n_get_coords; +static PyObject *__pyx_n___dealloc__; +static PyObject *__pyx_n___reduce__; +static PyObject *__pyx_n___init__; +static PyObject *__pyx_n_area; + +static PyObject *__pyx_k3p; + +static PyObject *__pyx_n_stdout; +static PyObject *__pyx_n_write; + +static PyObject *__pyx_k7p; + +static char (__pyx_k7[]) = "GEOS_NOTICE: %s\n"; + +static void __pyx_f_5_geos_notice_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { + PyObject *__pyx_v_format; + PyObject *__pyx_v_message; + PyObject *__pyx_v_warn_msg; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + __pyx_v_format = Py_None; Py_INCREF(Py_None); + __pyx_v_message = Py_None; Py_INCREF(Py_None); + __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":100 + * + * cdef void notice_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) # <<<<<<<<<<<<<< + * message = PyString_FromString(msg) + * try: + */ + __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":101 + * cdef void notice_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) # <<<<<<<<<<<<<< + * try: + * warn_msg = format % message + */ + __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":102 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":103 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L2;} + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_1; + __pyx_1 = 0; + } + goto __pyx_L3; + __pyx_L2:; + Py_XDECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":104 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("_geos.notice_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":105 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":106 + * except: + * warn_msg = format + * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) # <<<<<<<<<<<<<< + * + * cdef void error_h(char *fmt, char*msg): + */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_WriteUnraisable("_geos.notice_h"); + __pyx_L0:; + Py_DECREF(__pyx_v_format); + Py_DECREF(__pyx_v_message); + Py_DECREF(__pyx_v_warn_msg); +} + +static PyObject *__pyx_n_stderr; + +static PyObject *__pyx_k8p; + +static char (__pyx_k8[]) = "GEOS_ERROR: %s\n"; + +static void __pyx_f_5_geos_error_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { + PyObject *__pyx_v_format; + PyObject *__pyx_v_message; + PyObject *__pyx_v_warn_msg; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + __pyx_v_format = Py_None; Py_INCREF(Py_None); + __pyx_v_message = Py_None; Py_INCREF(Py_None); + __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":109 + * + * cdef void error_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) # <<<<<<<<<<<<<< + * message = PyString_FromString(msg) + * try: + */ + __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} + Py_DECREF(__pyx_v_format); + __pyx_v_format = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":110 + * cdef void error_h(char *fmt, char*msg): + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) # <<<<<<<<<<<<<< + * try: + * warn_msg = format % message + */ + __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;} + Py_DECREF(__pyx_v_message); + __pyx_v_message = __pyx_1; + __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":111 + * format = PyString_FromString(fmt) + * message = PyString_FromString(msg) + * try: # <<<<<<<<<<<<<< + * warn_msg = format % message + * except: + */ + /*try:*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":112 + * message = PyString_FromString(msg) + * try: + * warn_msg = format % message # <<<<<<<<<<<<<< + * except: + * warn_msg = format + */ + __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L2;} + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_1; + __pyx_1 = 0; + } + goto __pyx_L3; + __pyx_L2:; + Py_XDECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":113 + * try: + * warn_msg = format % message + * except: # <<<<<<<<<<<<<< + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + */ + /*except:*/ { + __Pyx_AddTraceback("_geos.error_h"); + __pyx_1 = __Pyx_GetExcValue(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":114 + * warn_msg = format % message + * except: + * warn_msg = format # <<<<<<<<<<<<<< + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) + * + */ + Py_INCREF(__pyx_v_format); + Py_DECREF(__pyx_v_warn_msg); + __pyx_v_warn_msg = __pyx_v_format; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":115 + * except: + * warn_msg = format + * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<< + * + * # intialize GEOS (parameters are notice and error function callbacks). + */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_WriteUnraisable("_geos.error_h"); + __pyx_L0:; + Py_DECREF(__pyx_v_format); + Py_DECREF(__pyx_v_message); + Py_DECREF(__pyx_v_warn_msg); +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused) { + char __pyx_v_valid; + PyObject *__pyx_r; + char __pyx_1; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":127 + * def is_valid(self): + * cdef char valid + * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<< + * if valid: + * return True + */ + __pyx_v_valid = GEOSisValid(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":128 + * cdef char valid + * valid = GEOSisValid(self._geom) + * if valid: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_valid; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":129 + * valid = GEOSisValid(self._geom) + * if valid: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":131 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def geom_type(self): + */ + Py_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":134 + * + * def geom_type(self): + * return PyString_FromString(GEOSGeomType(self._geom)) # <<<<<<<<<<<<<< + * + * def within(self, BaseGeometry geom): + */ + __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("_geos.BaseGeometry.geom_type"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { + GEOSGeom (*__pyx_v_g1); + GEOSGeom (*__pyx_v_g2); + char __pyx_v_answer; + PyObject *__pyx_r; + char __pyx_1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_geom); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":139 + * cdef GEOSGeom *g1, *g2 + * cdef char answer + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":140 + * cdef char answer + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * answer = GEOSWithin(g1, g2) + * if answer: + */ + __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":141 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSWithin(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":142 + * g2 = geom._geom + * answer = GEOSWithin(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":143 + * answer = GEOSWithin(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":145 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersects(self, BaseGeometry geom): + */ + Py_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + __Pyx_AddTraceback("_geos.BaseGeometry.within"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { + GEOSGeom (*__pyx_v_g1); + GEOSGeom (*__pyx_v_g2); + char __pyx_v_answer; + PyObject *__pyx_r; + char __pyx_1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_geom); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":150 + * cdef GEOSGeom *g1, *g2 + * cdef char answer + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":151 + * cdef char answer + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * answer = GEOSIntersects(g1, g2) + * if answer: + */ + __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":152 + * g1 = self._geom + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<< + * if answer: + * return True + */ + __pyx_v_answer = GEOSIntersects(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":153 + * g2 = geom._geom + * answer = GEOSIntersects(g1, g2) + * if answer: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_1 = __pyx_v_answer; + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":154 + * answer = GEOSIntersects(g1, g2) + * if answer: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + Py_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":156 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * + * def intersection(self, BaseGeometry geom): + */ + Py_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + __Pyx_AddTraceback("_geos.BaseGeometry.intersects"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_n_append; +static PyObject *__pyx_n_NotImplementedError; + +static PyObject *__pyx_k9p; + +static PyObject *__pyx_builtin_NotImplementedError; + +static char (__pyx_k9[]) = "intersections of type '%s' not yet implemented"; + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { + GEOSGeom (*__pyx_v_g1); + GEOSGeom (*__pyx_v_g2); + GEOSGeom (*__pyx_v_g3); + GEOSGeom (*__pyx_v_gout); + int __pyx_v_numgeoms; + int __pyx_v_i; + int __pyx_v_typeid; + PyObject *__pyx_v_p; + PyObject *__pyx_v_pout; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_geom); + __pyx_v_p = Py_None; Py_INCREF(Py_None); + __pyx_v_pout = Py_None; Py_INCREF(Py_None); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":162 + * cdef char answer + * cdef int numgeoms, i, typeid + * g1 = self._geom # <<<<<<<<<<<<<< + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) + */ + __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":163 + * cdef int numgeoms, i, typeid + * g1 = self._geom + * g2 = geom._geom # <<<<<<<<<<<<<< + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) + */ + __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":164 + * g1 = self._geom + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) # <<<<<<<<<<<<<< + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + */ + __pyx_v_g3 = GEOSIntersection(__pyx_v_g1,__pyx_v_g2); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":165 + * g2 = geom._geom + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + */ + __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":166 + * g3 = GEOSIntersection(g1, g2) + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. + */ + __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":167 + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) # add geometry to it. + * # above should be faster than this .. + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":168 + * if typeid == GEOS_POLYGON: + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< + * # above should be faster than this .. + * #b = _get_coords(g3) + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":172 + * #b = _get_coords(g3) + * #p = Polygon(b) + * pout = [p] # return a list with a single element # <<<<<<<<<<<<<< + * elif typeid == GEOS_LINESTRING: + * p = LineString() # create an empty LineString instance + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":174 + * pout = [p] # return a list with a single element + * elif typeid == GEOS_LINESTRING: + * p = LineString() # create an empty LineString instance # <<<<<<<<<<<<<< + * p = _add_geom(p,g3) # add geometry to it. + * return [p] + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":175 + * elif typeid == GEOS_LINESTRING: + * p = LineString() # create an empty LineString instance + * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":176 + * p = LineString() # create an empty LineString instance + * p = _add_geom(p,g3) # add geometry to it. + * return [p] # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":178 + * return [p] + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":179 + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":180 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":181 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":182 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":183 + * gout = GEOSGetGeometryN(g3, i) + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":184 + * p = Polygon() # create an empty Polygon instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":186 + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":187 + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":188 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an LineString instance + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":189 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * p = LineString() # create an LineString instance + * p = _add_geom(p,gout) # add geometry to it. + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":190 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an LineString instance # <<<<<<<<<<<<<< + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) + */ + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_3; + __pyx_3 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":191 + * gout = GEOSGetGeometryN(g3, i) + * p = LineString() # create an LineString instance + * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * pout.append(p) + * else: + */ + if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + __pyx_4 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + Py_DECREF(__pyx_v_p); + __pyx_v_p = __pyx_4; + __pyx_4 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":192 + * p = LineString() # create an LineString instance + * p = _add_geom(p,gout) # add geometry to it. + * pout.append(p) # <<<<<<<<<<<<<< + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + Py_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":194 + * pout.append(p) + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< + * return pout + * + */ + __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":195 + * else: + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * return pout # <<<<<<<<<<<<<< + * + * def get_coords(self): + */ + Py_INCREF(__pyx_v_pout); + __pyx_r = __pyx_v_pout; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_AddTraceback("_geos.BaseGeometry.intersection"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_p); + Py_DECREF(__pyx_v_pout); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_geom); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_f_py_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":198 + * + * def get_coords(self): + * return _get_coords(self._geom) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_1 = __pyx_f_5_geos__get_coords(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("_geos.BaseGeometry.get_coords"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static void __pyx_f_py_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_5_geos_12BaseGeometry___dealloc__[] = "destroy GEOS geometry"; +static void __pyx_f_py_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self) { + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":202 + * def __dealloc__(self): + * """destroy GEOS geometry""" + * GEOSGeom_destroy(self._geom) # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ + GEOSGeom_destroy(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); + + Py_DECREF(__pyx_v_self); +} + +static PyObject *__pyx_n___class__; + +static PyObject *__pyx_f_py_5_geos_12BaseGeometry___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static char __pyx_doc_5_geos_12BaseGeometry___reduce__[] = "special method that allows geos instance to be pickled"; +static PyObject *__pyx_f_py_5_geos_12BaseGeometry___reduce__(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":206 + * def __reduce__(self): + * """special method that allows geos instance to be pickled""" + * return (self.__class__,(self.boundary,)) # <<<<<<<<<<<<<< + * + * cdef class Polygon(BaseGeometry): + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} + Py_INCREF(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary); + PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary); + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); + __pyx_1 = 0; + __pyx_2 = 0; + __pyx_r = __pyx_3; + __pyx_3 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_AddTraceback("_geos.BaseGeometry.__reduce__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_num_neg_1; +static PyObject *__pyx_num_0; +static PyObject *__pyx_num_1; + +static PyObject *__pyx_n_copy; +static PyObject *__pyx_n_shape; + +static int __pyx_f_py_5_geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_py_5_geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_b = 0; + unsigned int __pyx_v_M; + unsigned int __pyx_v_m; + unsigned int __pyx_v_i; + double __pyx_v_dx; + double __pyx_v_dy; + double (*__pyx_v_bbuffer); + GEOSCoordSeq (*__pyx_v_cs); + GEOSGeom (*__pyx_v_lr); + int __pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + unsigned int __pyx_5; + PyObject *__pyx_6 = 0; + static char *__pyx_argnames[] = {"b",0}; + __pyx_v_b = __pyx_k4; + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_b))) return -1; + Py_INCREF((PyObject *)__pyx_v_self); + Py_INCREF(__pyx_v_b); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5_geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":218 + * + * # just return an empty class + * if b is None: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_1 = (((PyObject *)__pyx_v_b) == Py_None); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":219 + * # just return an empty class + * if b is None: + * return # <<<<<<<<<<<<<< + * + * # make sure data is contiguous. + */ + __pyx_r = 0; + goto __pyx_L0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":223 + * # make sure data is contiguous. + * # if not, make a local copy. + * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<< + * b = b.copy() + * + */ + __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b)); + if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":224 + * # if not, make a local copy. + * if not PyArray_ISCONTIGUOUS(b): + * b = b.copy() # <<<<<<<<<<<<<< ... [truncated message content] |
From: <js...@us...> - 2007-11-13 23:03:00
|
Revision: 4259 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4259&view=rev Author: jswhit Date: 2007-11-13 15:02:59 -0800 (Tue, 13 Nov 2007) Log Message: ----------- more fixes for pickling Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py trunk/toolkits/basemap-testing/src/_geos.c trunk/toolkits/basemap-testing/src/_geos.pyx Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 22:26:02 UTC (rev 4258) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-13 23:02:59 UTC (rev 4259) @@ -772,7 +772,7 @@ maptran = pyproj.Proj(proj='stere',lon_0=lon_0,lat_0=lat_0) # boundary polygon for orthographic projection # in stereographic coorindates. - b = self._boundarypolyll.get_coords() + b = self._boundarypolyll.boundary blons = b[:,0]; blats = b[:,1] b[:,0], b[:,1] = maptran(blons, blats) boundarypolyxy = _geos.Polygon(b) @@ -854,7 +854,7 @@ # which have a 'boundary' attribute. # otherwise, use 'coords' attribute # to extract coordinates. - b = psub.get_coords() + b = psub.boundary blons = b[:,0]; blats = b[:,1] # transformation from lat/lon to # map projection coordinates. @@ -904,7 +904,7 @@ pass # iterate over geometries in intersection. for psub in geoms: - b = psub.get_coords() + b = psub.boundary # if projection == 'ortho', # transform polygon from stereographic # to orthographic coordinates. Modified: trunk/toolkits/basemap-testing/src/_geos.c =================================================================== --- trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 22:26:02 UTC (rev 4258) +++ trunk/toolkits/basemap-testing/src/_geos.c 2007-11-13 23:02:59 UTC (rev 4259) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.7 on Tue Nov 13 15:19:22 2007 */ +/* Generated by Cython 0.9.6.7 on Tue Nov 13 16:02:30 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -77,10 +77,10 @@ static void __Pyx_WriteUnraisable(char *name); /*proto*/ -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ @@ -121,9 +121,6 @@ static PyTypeObject *__pyx_ptype_5_geos_Polygon = 0; static PyTypeObject *__pyx_ptype_5_geos_LineString = 0; static PyTypeObject *__pyx_ptype_5_geos_Point = 0; -static PyArrayObject *__pyx_k4; -static PyArrayObject *__pyx_k5; -static PyObject *__pyx_k6; static void (__pyx_f_5_geos_notice_h(char (*),char (*))); /*proto*/ static void (__pyx_f_5_geos_error_h(char (*),char (*))); /*proto*/ static PyObject *(__pyx_f_5_geos__add_geom(struct __pyx_obj_5_geos_BaseGeometry *,GEOSGeom (*))); /*proto*/ @@ -153,9 +150,9 @@ static PyObject *__pyx_n_stdout; static PyObject *__pyx_n_write; -static PyObject *__pyx_k7p; +static PyObject *__pyx_k4p; -static char (__pyx_k7[]) = "GEOS_NOTICE: %s\n"; +static char (__pyx_k4[]) = "GEOS_NOTICE: %s\n"; static void __pyx_f_5_geos_notice_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { PyObject *__pyx_v_format; @@ -255,7 +252,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k4p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; @@ -278,9 +275,9 @@ static PyObject *__pyx_n_stderr; -static PyObject *__pyx_k8p; +static PyObject *__pyx_k5p; -static char (__pyx_k8[]) = "GEOS_ERROR: %s\n"; +static char (__pyx_k5[]) = "GEOS_ERROR: %s\n"; static void __pyx_f_5_geos_error_h(char (*__pyx_v_fmt),char (*__pyx_v_msg)) { PyObject *__pyx_v_format; @@ -380,7 +377,7 @@ Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyNumber_Remainder(__pyx_k8p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k5p, __pyx_v_warn_msg); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; @@ -664,11 +661,11 @@ static PyObject *__pyx_n_append; static PyObject *__pyx_n_NotImplementedError; -static PyObject *__pyx_k9p; +static PyObject *__pyx_k6p; static PyObject *__pyx_builtin_NotImplementedError; -static char (__pyx_k9[]) = "intersections of type '%s' not yet implemented"; +static char (__pyx_k6[]) = "intersections of type '%s' not yet implemented"; static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ static PyObject *__pyx_f_py_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { @@ -679,8 +676,10 @@ int __pyx_v_numgeoms; int __pyx_v_i; int __pyx_v_typeid; + PyObject *__pyx_v_b; PyObject *__pyx_v_p; PyObject *__pyx_v_pout; + PyObject *__pyx_v_type; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; @@ -688,8 +687,10 @@ PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_geom); + __pyx_v_b = Py_None; Py_INCREF(Py_None); __pyx_v_p = Py_None; Py_INCREF(Py_None); __pyx_v_pout = Py_None; Py_INCREF(Py_None); + __pyx_v_type = Py_None; Py_INCREF(Py_None); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;} /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":162 @@ -724,7 +725,7 @@ * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< * if typeid == GEOS_POLYGON: - * p = Polygon() # create an empty Polygon instance + * b = _get_coords(g3) */ __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); @@ -732,8 +733,8 @@ * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,g3) # add geometry to it. + * b = _get_coords(g3) + * p = Polygon(b) */ __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); if (__pyx_1) { @@ -741,36 +742,39 @@ /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":167 * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: - * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< - * p = _add_geom(p,g3) # add geometry to it. - * # above should be faster than this .. + * b = _get_coords(g3) # <<<<<<<<<<<<<< + * p = Polygon(b) + * pout = [p] */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; + __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_2; __pyx_2 = 0; /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":168 * if typeid == GEOS_POLYGON: - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< - * # above should be faster than this .. - * #b = _get_coords(g3) + * b = _get_coords(g3) + * p = Polygon(b) # <<<<<<<<<<<<<< + * pout = [p] + * elif typeid == GEOS_LINESTRING: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} - __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + Py_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b); + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; - __pyx_2 = 0; + __pyx_v_p = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":172 - * #b = _get_coords(g3) - * #p = Polygon(b) - * pout = [p] # return a list with a single element # <<<<<<<<<<<<<< + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":169 + * b = _get_coords(g3) + * p = Polygon(b) + * pout = [p] # <<<<<<<<<<<<<< * elif typeid == GEOS_LINESTRING: - * p = LineString() # create an empty LineString instance + * b = _get_coords(g3) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); Py_DECREF(__pyx_v_pout); @@ -781,51 +785,54 @@ __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":174 - * pout = [p] # return a list with a single element + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":171 + * pout = [p] * elif typeid == GEOS_LINESTRING: - * p = LineString() # create an empty LineString instance # <<<<<<<<<<<<<< - * p = _add_geom(p,g3) # add geometry to it. - * return [p] + * b = _get_coords(g3) # <<<<<<<<<<<<<< + * p = LineString(b) + * pout = [p] */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; - __pyx_2 = 0; + __pyx_3 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":175 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":172 * elif typeid == GEOS_LINESTRING: - * p = LineString() # create an empty LineString instance - * p = _add_geom(p,g3) # add geometry to it. # <<<<<<<<<<<<<< - * return [p] + * b = _get_coords(g3) + * p = LineString(b) # <<<<<<<<<<<<<< + * pout = [p] * elif typeid == GEOS_MULTIPOLYGON: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} - __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + Py_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b); + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; - __pyx_2 = 0; + __pyx_v_p = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":176 - * p = LineString() # create an empty LineString instance - * p = _add_geom(p,g3) # add geometry to it. - * return [p] # <<<<<<<<<<<<<< + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":173 + * b = _get_coords(g3) + * p = LineString(b) + * pout = [p] # <<<<<<<<<<<<<< * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); - __pyx_r = __pyx_2; + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = __pyx_2; __pyx_2 = 0; - goto __pyx_L0; goto __pyx_L2; } __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":178 - * return [p] + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":175 + * pout = [p] * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< * pout = [] @@ -833,75 +840,78 @@ */ __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":179 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":176 * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) * pout = [] # <<<<<<<<<<<<<< * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) */ - __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_2; - __pyx_2 = 0; + __pyx_v_pout = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":180 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":177 * numgeoms = GEOSGetNumGeometries(g3) * pout = [] * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< * gout = GEOSGetGeometryN(g3, i) - * p = Polygon() # create an empty Polygon instance + * b = _get_coords(gout) */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":181 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":178 * pout = [] * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) + * p = Polygon(b) */ __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":182 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":179 * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) - * p = Polygon() # create an empty Polygon instance # <<<<<<<<<<<<<< - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) # <<<<<<<<<<<<<< + * p = Polygon(b) * pout.append(p) */ - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; + __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":183 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":180 * gout = GEOSGetGeometryN(g3, i) - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * b = _get_coords(gout) + * p = Polygon(b) # <<<<<<<<<<<<<< * pout.append(p) * elif typeid == GEOS_MULTILINESTRING: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} - __pyx_2 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + Py_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_b); + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_2; __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":184 - * p = Polygon() # create an empty Polygon instance - * p = _add_geom(p,gout) # add geometry to it. + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":181 + * b = _get_coords(gout) + * p = Polygon(b) * pout.append(p) # <<<<<<<<<<<<<< * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) */ - __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; } goto __pyx_L2; @@ -909,7 +919,7 @@ __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":186 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":183 * pout.append(p) * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< @@ -918,102 +928,117 @@ */ __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":187 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":184 * elif typeid == GEOS_MULTILINESTRING: * numgeoms = GEOSGetNumGeometries(g3) * pout = [] # <<<<<<<<<<<<<< * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) */ - __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_2; - __pyx_2 = 0; + __pyx_v_pout = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":188 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":185 * numgeoms = GEOSGetNumGeometries(g3) * pout = [] * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an LineString instance + * b = _get_coords(gout) */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":189 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":186 * pout = [] * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< - * p = LineString() # create an LineString instance - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) + * p = LineString(b) */ __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3,__pyx_v_i); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":190 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":187 * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an LineString instance # <<<<<<<<<<<<<< - * p = _add_geom(p,gout) # add geometry to it. + * b = _get_coords(gout) # <<<<<<<<<<<<<< + * p = LineString(b) * pout.append(p) */ - __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;} - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_3; - __pyx_3 = 0; + __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_2; + __pyx_2 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":191 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":188 * gout = GEOSGetGeometryN(g3, i) - * p = LineString() # create an LineString instance - * p = _add_geom(p,gout) # add geometry to it. # <<<<<<<<<<<<<< + * b = _get_coords(gout) + * p = LineString(b) # <<<<<<<<<<<<<< * pout.append(p) * else: */ - if (!__Pyx_TypeTest(__pyx_v_p, __pyx_ptype_5_geos_BaseGeometry)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} - __pyx_4 = __pyx_f_5_geos__add_geom(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_p),__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;} + Py_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_b); + __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_4; - __pyx_4 = 0; + __pyx_v_p = __pyx_3; + __pyx_3 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":192 - * p = LineString() # create an LineString instance - * p = _add_geom(p,gout) # add geometry to it. + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":189 + * b = _get_coords(gout) + * p = LineString(b) * pout.append(p) # <<<<<<<<<<<<<< * else: - * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * type = PyString_FromString(GEOSGeomType(g3)) */ - __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; } goto __pyx_L2; } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":194 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":191 * pout.append(p) * else: + * type = PyString_FromString(GEOSGeomType(g3)) # <<<<<<<<<<<<<< + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * return pout + */ + __pyx_2 = PyString_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} + Py_DECREF(__pyx_v_type); + __pyx_v_type = __pyx_2; + __pyx_2 = 0; + + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":192 + * else: + * type = PyString_FromString(GEOSGeomType(g3)) * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< * return pout * */ - __pyx_2 = PyNumber_Remainder(__pyx_k9p, ((PyObject*)&PyType_Type)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); - __pyx_2 = 0; - __pyx_4 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __pyx_4 = PyNumber_Remainder(__pyx_k6p, __pyx_v_type); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); + __pyx_4 = 0; + __pyx_2 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":195 - * else: + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":193 + * type = PyString_FromString(GEOSGeomType(g3)) * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) * return pout # <<<<<<<<<<<<<< * @@ -1032,8 +1057,10 @@ __Pyx_AddTraceback("_geos.BaseGeometry.intersection"); __pyx_r = 0; __pyx_L0:; + Py_DECREF(__pyx_v_b); Py_DECREF(__pyx_v_p); Py_DECREF(__pyx_v_pout); + Py_DECREF(__pyx_v_type); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_geom); return __pyx_r; @@ -1045,14 +1072,14 @@ PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":198 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":196 * * def get_coords(self): * return _get_coords(self._geom) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_1 = __pyx_f_5_geos__get_coords(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} + __pyx_1 = __pyx_f_5_geos__get_coords(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -1073,7 +1100,7 @@ static void __pyx_f_py_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self) { Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":202 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":200 * def __dealloc__(self): * """destroy GEOS geometry""" * GEOSGeom_destroy(self._geom) # <<<<<<<<<<<<<< @@ -1096,18 +1123,18 @@ PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":206 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":204 * def __reduce__(self): * """special method that allows geos instance to be pickled""" * return (self.__class__,(self.boundary,)) # <<<<<<<<<<<<<< * * cdef class Polygon(BaseGeometry): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} Py_INCREF(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary); PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary); - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); __pyx_1 = 0; @@ -1155,37 +1182,13 @@ unsigned int __pyx_5; PyObject *__pyx_6 = 0; static char *__pyx_argnames[] = {"b",0}; - __pyx_v_b = __pyx_k4; - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_b))) return -1; + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_b))) return -1; Py_INCREF((PyObject *)__pyx_v_self); Py_INCREF(__pyx_v_b); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5_geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5_geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":218 - * - * # just return an empty class - * if b is None: # <<<<<<<<<<<<<< - * return - * - */ - __pyx_1 = (((PyObject *)__pyx_v_b) == Py_None); - if (__pyx_1) { - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":219 - * # just return an empty class - * if b is None: - * return # <<<<<<<<<<<<<< - * + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":217 * # make sure data is contiguous. - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L2; - } - __pyx_L2:; - - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":223 - * # make sure data is contiguous. * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<< * b = b.copy() @@ -1194,96 +1197,96 @@ __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b)); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":224 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":218 * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(b): * b = b.copy() # <<<<<<<<<<<<<< * * m = b.shape[0] */ - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":226 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":220 * b = b.copy() * * m = b.shape[0] # <<<<<<<<<<<<<< * * # Add closing coordinates to sequence? */ - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} if (PyList_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_2)) { __pyx_4 = PyList_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4); } else if (PyTuple_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_2)) { __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4); } else { - __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; } Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_m = __pyx_5; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":229 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":223 * * # Add closing coordinates to sequence? * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: # <<<<<<<<<<<<<< * M = m + 1 * else: */ - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_INCREF(__pyx_num_neg_1); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1); Py_INCREF(__pyx_num_0); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0); - __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_INCREF(__pyx_num_0); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_0); Py_INCREF(__pyx_num_0); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0); - __pyx_6 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_6, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_6, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} if (!__pyx_1) { Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_INCREF(__pyx_num_neg_1); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1); Py_INCREF(__pyx_num_1); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_1); - __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_INCREF(__pyx_num_0); PyTuple_SET_ITEM(__pyx_6, 0, __pyx_num_0); Py_INCREF(__pyx_num_1); PyTuple_SET_ITEM(__pyx_6, 1, __pyx_num_1); - __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; } - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":230 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":224 * # Add closing coordinates to sequence? * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: * M = m + 1 # <<<<<<<<<<<<<< @@ -1291,11 +1294,11 @@ * M = m */ __pyx_v_M = (__pyx_v_m + 1); - goto __pyx_L4; + goto __pyx_L3; } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":232 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":226 * M = m + 1 * else: * M = m # <<<<<<<<<<<<<< @@ -1304,9 +1307,9 @@ */ __pyx_v_M = __pyx_v_m; } - __pyx_L4:; + __pyx_L3:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":233 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":227 * else: * M = m * self._npts = M # <<<<<<<<<<<<<< @@ -1315,7 +1318,7 @@ */ ((struct __pyx_obj_5_geos_Polygon *)__pyx_v_self)->__pyx_base._npts = __pyx_v_M; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":236 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":230 * * # Create a coordinate sequence * cs = GEOSCoordSeq_create(M, 2) # <<<<<<<<<<<<<< @@ -1324,7 +1327,7 @@ */ __pyx_v_cs = GEOSCoordSeq_create(__pyx_v_M,2); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":239 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":233 * * # add to coordinate sequence * bbuffer = <double *>b.data # <<<<<<<<<<<<<< @@ -1333,7 +1336,7 @@ */ __pyx_v_bbuffer = ((double (*))__pyx_v_b->data); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":240 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":234 * # add to coordinate sequence * bbuffer = <double *>b.data * for i from 0 <= i < m: # <<<<<<<<<<<<<< @@ -1342,7 +1345,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_m; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":241 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":235 * bbuffer = <double *>b.data * for i from 0 <= i < m: * dx = bbuffer[2*i] # <<<<<<<<<<<<<< @@ -1351,7 +1354,7 @@ */ __pyx_v_dx = (__pyx_v_bbuffer[(2 * __pyx_v_i)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":242 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":236 * for i from 0 <= i < m: * dx = bbuffer[2*i] * dy = bbuffer[2*i+1] # <<<<<<<<<<<<<< @@ -1360,7 +1363,7 @@ */ __pyx_v_dy = (__pyx_v_bbuffer[((2 * __pyx_v_i) + 1)]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":245 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":239 * # Because of a bug in the GEOS C API, * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) # <<<<<<<<<<<<<< @@ -1369,7 +1372,7 @@ */ GEOSCoordSeq_setX(__pyx_v_cs,__pyx_v_i,__pyx_v_dx); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":246 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":240 * # always set X before Y * GEOSCoordSeq_setX(cs, i, dx) * GEOSCoordSeq_setY(cs, i, dy) # <<<<<<<<<<<<<< @@ -1379,7 +1382,7 @@ GEOSCoordSeq_setY(__pyx_v_cs,__pyx_v_i,__pyx_v_dy); } - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":249 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":243 * * # Add closing coordinates to sequence? * if M > m: # <<<<<<<<<<<<<< @@ -1389,7 +1392,7 @@ __pyx_1 = (__pyx_v_M > __pyx_v_m); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":250 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":244 * # Add closing coordinates to sequence? * if M > m: * dx = bbuffer[0] # <<<<<<<<<<<<<< @@ -1398,7 +1401,7 @@ */ __pyx_v_dx = (__pyx_v_bbuffer[0]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":251 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":245 * if M > m: * dx = bbuffer[0] * dy = bbuffer[1] # <<<<<<<<<<<<<< @@ -1407,7 +1410,7 @@ */ __pyx_v_dy = (__pyx_v_bbuffer[1]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":252 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":246 * dx = bbuffer[0] * dy = bbuffer[1] * GEOSCoordSeq_setX(cs, M-1, dx) # <<<<<<<<<<<<<< @@ -1416,7 +1419,7 @@ */ GEOSCoordSeq_setX(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dx); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":253 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":247 * dy = bbuffer[1] * GEOSCoordSeq_setX(cs, M-1, dx) * GEOSCoordSeq_setY(cs, M-1, dy) # <<<<<<<<<<<<<< @@ -1424,11 +1427,11 @@ * # create LinearRing */ GEOSCoordSeq_setY(__pyx_v_cs,(__pyx_v_M - 1),__pyx_v_dy); - goto __pyx_L7; + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":256 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":250 * * # create LinearRing * lr = GEOSGeom_createLinearRing(cs) # <<<<<<<<<<<<<< @@ -1437,7 +1440,7 @@ */ __pyx_v_lr = GEOSGeom_createLinearRing(__pyx_v_cs); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":259 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":253 * * # create Polygon from LinearRing (assuming no holes) * self._geom = GEOSGeom_createPolygon(lr,NULL,0) # <<<<<<<<<<<<<< @@ -1446,7 +1449,7 @@ */ ((struct __pyx_obj_5_geos_Polygon *)__pyx_v_self)->__pyx_base._geom = GEOSGeom_createPolygon(__pyx_v_lr,NULL,0); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":260 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":254 * # create Polygon from LinearRing (assuming no holes) * self._geom = GEOSGeom_createPolygon(lr,NULL,0) * self.boundary = b # <<<<<<<<<<<<<< @@ -1479,7 +1482,7 @@ PyObject *__pyx_1 = 0; Py_INCREF((PyObject *)__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":265 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":259 * def area(self): * cdef double area * GEOSArea(self._geom, &area) # <<<<<<<<<<<<<< @@ -1488,14 +1491,14 @@ */ GEOSArea(((struct __pyx_obj_5_geos_Polygon *)__pyx_v_self)->__pyx_base._geom,(&__pyx_v_area)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":266 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":260 * cdef double area * GEOSArea(self._geom, &area) * return area # <<<<<<<<<<<<<< * * cdef _add_geom(BaseGeometry p, GEOSGeom *geom): */ - __pyx_1 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;} + __pyx_1 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -1519,7 +1522,7 @@ int __pyx_1; Py_INCREF(__pyx_v_p); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":272 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":266 * cdef GEOSGeom *lr * cdef unsigned int M * if GEOSGeomTypeId(geom) == GEOS_POLYGON: # <<<<<<<<<<<<<< @@ -1529,7 +1532,7 @@ __pyx_1 = (GEOSGeomTypeId(__pyx_v_geom) == GEOS_POLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":273 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":267 * cdef unsigned int M * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) # <<<<<<<<<<<<<< @@ -1538,7 +1541,7 @@ */ __pyx_v_lr = GEOSGetExteriorRing(__pyx_v_geom); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":274 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":268 * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) * cs = GEOSGeom_getCoordSeq(lr) # <<<<<<<<<<<<<< @@ -1550,7 +1553,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":276 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":270 * cs = GEOSGeom_getCoordSeq(lr) * else: * cs = GEOSGeom_getCoordSeq(geom) # <<<<<<<<<<<<<< @@ -1561,7 +1564,7 @@ } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":277 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":271 * else: * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) # <<<<<<<<<<<<<< @@ -1570,7 +1573,7 @@ */ GEOSCoordSeq_getSize(__pyx_v_cs,(&__pyx_v_M)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":278 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":272 * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) * p._geom = geom # <<<<<<<<<<<<<< @@ -1579,7 +1582,7 @@ */ __pyx_v_p->_geom = __pyx_v_geom; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":279 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":273 * GEOSCoordSeq_getSize(cs, &M) * p._geom = geom * p._npts = M # <<<<<<<<<<<<<< @@ -1588,7 +1591,7 @@ */ __pyx_v_p->_npts = __pyx_v_M; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":280 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":274 * p._geom = geom * p._npts = M * return p # <<<<<<<<<<<<<< @@ -1627,7 +1630,7 @@ PyObject *__pyx_5 = 0; __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":289 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":283 * cdef ndarray b * cdef double *bbuffer * if GEOSGeomTypeId(geom) == GEOS_POLYGON: # <<<<<<<<<<<<<< @@ -1637,7 +1640,7 @@ __pyx_1 = (GEOSGeomTypeId(__pyx_v_geom) == GEOS_POLYGON); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":290 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":284 * cdef double *bbuffer * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) # <<<<<<<<<<<<<< @@ -1646,7 +1649,7 @@ */ __pyx_v_lr = GEOSGetExteriorRing(__pyx_v_geom); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":291 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":285 * if GEOSGeomTypeId(geom) == GEOS_POLYGON: * lr = GEOSGetExteriorRing(geom) * cs = GEOSGeom_getCoordSeq(lr) # <<<<<<<<<<<<<< @@ -1658,7 +1661,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":293 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":287 * cs = GEOSGeom_getCoordSeq(lr) * else: * cs = GEOSGeom_getCoordSeq(geom) # <<<<<<<<<<<<<< @@ -1669,7 +1672,7 @@ } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":294 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":288 * else: * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) # <<<<<<<<<<<<<< @@ -1678,39 +1681,39 @@ */ GEOSCoordSeq_getSize(__pyx_v_cs,(&__pyx_v_M)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":295 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":289 * cs = GEOSGeom_getCoordSeq(geom) * GEOSCoordSeq_getSize(cs, &M) * b = numpy.empty((M,2), numpy.float64) # <<<<<<<<<<<<<< * bbuffer = <double *>b.data * for i from 0 <= i < M: */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_M); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_M); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); Py_INCREF(__pyx_num_2); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_num_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); __pyx_4 = 0; __pyx_5 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":296 + /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geos.pyx":290 * GEOSCoordSeq_getSize(cs, &M) * b = numpy.empty((M,2), numpy.float64) * bbuffer = <doub... [truncated message content] |
From: <js...@us...> - 2007-11-14 19:45:52
|
Revision: 4291 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4291&view=rev Author: jswhit Date: 2007-11-14 11:45:49 -0800 (Wed, 14 Nov 2007) Log Message: ----------- include GEOS library source code Modified Paths: -------------- trunk/toolkits/basemap-testing/README trunk/toolkits/basemap-testing/setup.py Added Paths: ----------- trunk/toolkits/basemap-testing/geos-2.2.3/ trunk/toolkits/basemap-testing/geos-2.2.3/AUTHORS trunk/toolkits/basemap-testing/geos-2.2.3/COPYING trunk/toolkits/basemap-testing/geos-2.2.3/ChangeLog trunk/toolkits/basemap-testing/geos-2.2.3/INSTALL trunk/toolkits/basemap-testing/geos-2.2.3/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/NEWS trunk/toolkits/basemap-testing/geos-2.2.3/README trunk/toolkits/basemap-testing/geos-2.2.3/TODO trunk/toolkits/basemap-testing/geos-2.2.3/VisualStudio/ trunk/toolkits/basemap-testing/geos-2.2.3/VisualStudio/GEOS.sln trunk/toolkits/basemap-testing/geos-2.2.3/VisualStudio/GEOS.vcproj trunk/toolkits/basemap-testing/geos-2.2.3/VisualStudio/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/VisualStudio/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/aclocal.m4 trunk/toolkits/basemap-testing/geos-2.2.3/acsite.m4 trunk/toolkits/basemap-testing/geos-2.2.3/config.guess trunk/toolkits/basemap-testing/geos-2.2.3/config.sub trunk/toolkits/basemap-testing/geos-2.2.3/configure trunk/toolkits/basemap-testing/geos-2.2.3/configure.in trunk/toolkits/basemap-testing/geos-2.2.3/depcomp trunk/toolkits/basemap-testing/geos-2.2.3/doc/ trunk/toolkits/basemap-testing/geos-2.2.3/doc/Doxyfile trunk/toolkits/basemap-testing/geos-2.2.3/doc/Doxyfile.in trunk/toolkits/basemap-testing/geos-2.2.3/doc/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/doc/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/doc/README trunk/toolkits/basemap-testing/geos-2.2.3/doc/example.cpp trunk/toolkits/basemap-testing/geos-2.2.3/install-sh trunk/toolkits/basemap-testing/geos-2.2.3/ltmain.sh trunk/toolkits/basemap-testing/geos-2.2.3/macros/ trunk/toolkits/basemap-testing/geos-2.2.3/macros/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/macros/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/macros/geos.m4 trunk/toolkits/basemap-testing/geos-2.2.3/missing trunk/toolkits/basemap-testing/geos-2.2.3/source/ trunk/toolkits/basemap-testing/geos-2.2.3/source/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/source/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/source/Makefile.vc trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/ trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/CGAlgorithms.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/CentroidArea.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/CentroidLine.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/CentroidPoint.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/ConvexHull.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/HCoordinate.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/InteriorPointArea.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/InteriorPointLine.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/InteriorPointPoint.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/LineIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/MCPointInRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/MinimumDiameter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/NonRobustCGAlgorithms.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/NonRobustLineIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/NotRepresentableException.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/PointLocator.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/RobustCGAlgorithms.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/RobustDeterminant.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/RobustLineIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/SIRtreePointInRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/SimplePointInAreaLocator.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/algorithm/SimplePointInRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/bigtest/ trunk/toolkits/basemap-testing/geos-2.2.3/source/bigtest/GeometryTestFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/bigtest/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/source/bigtest/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/source/bigtest/TestSweepLineSpeed.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/bigtest/bigtest.h trunk/toolkits/basemap-testing/geos-2.2.3/source/capi/ trunk/toolkits/basemap-testing/geos-2.2.3/source/capi/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/source/capi/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/source/capi/geos_c.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/capi/geos_c.h.in trunk/toolkits/basemap-testing/geos-2.2.3/source/capi/geostest.c trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/ trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Coordinate.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/CoordinateSequence.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/CoordinateSequenceFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/DefaultCoordinateSequence.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/DefaultCoordinateSequenceFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Dimension.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Envelope.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Geometry.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/GeometryCollection.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/GeometryCollectionIterator.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/GeometryComponentFilter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/GeometryFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/IntersectionMatrix.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/LineSegment.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/LineString.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/LinearRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Location.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/MultiLineString.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/MultiPoint.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/MultiPolygon.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Point.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/PointCoordinateSequence.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/PointCoordinateSequenceFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Polygon.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/PrecisionModel.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/TopologyException.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/Triangle.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/util/ trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/util/GeometryEditor.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/util/LinearComponentExtracter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/util/PointExtracter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geom/util/PolygonExtracter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/ trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/Depth.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/DirectedEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/DirectedEdgeStar.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/Edge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/EdgeEnd.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/EdgeEndStar.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/EdgeIntersection.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/EdgeIntersectionList.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/EdgeList.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/EdgeNodingValidator.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/EdgeRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/GeometryGraph.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/GraphComponent.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/Label.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/Node.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/NodeFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/NodeMap.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/PlanarGraph.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/Position.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/Quadrant.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/TopologyLocation.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/ trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/MonotoneChain.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/MonotoneChainEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/MonotoneChainIndexer.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/SegmentIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/SimpleEdgeSetIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/SimpleMCSweepLineIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/SimpleSweepLineIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/SweepLineEvent.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/geomgraph/index/SweepLineSegment.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/ trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/config.h.in trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/ trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/geom.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/geomUtil.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/geomgraph.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/geomgraphindex.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/geosAlgorithm.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/indexBintree.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/indexChain.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/indexQuadtree.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/indexStrtree.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/indexSweepline.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/io.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/noding.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/nodingSnapround.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/opBuffer.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/opDistance.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/opLinemerge.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/opOverlay.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/opPolygonize.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/opRelate.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/opValid.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/operation.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/planargraph.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/platform.h.in trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/platform.h.vc trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/precision.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/profiler.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/spatialIndex.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/unload.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/util.h trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/version.h.in trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos.h trunk/toolkits/basemap-testing/geos-2.2.3/source/index/ trunk/toolkits/basemap-testing/geos-2.2.3/source/index/bintree/ trunk/toolkits/basemap-testing/geos-2.2.3/source/index/bintree/BinTreeInterval.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/bintree/BinTreeNode.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/bintree/Bintree.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/bintree/Key.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/bintree/NodeBase.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/bintree/Root.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/chain/ trunk/toolkits/basemap-testing/geos-2.2.3/source/index/chain/MonotoneChainBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/chain/MonotoneChainOverlapAction.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/chain/MonotoneChainSelectAction.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/chain/indexMonotoneChain.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/ trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/DoubleBits.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/IntervalSize.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/QuadTreeKey.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/QuadTreeNode.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/QuadTreeNodeBase.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/QuadTreeRoot.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/quadtree/Quadtree.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/strtree/ trunk/toolkits/basemap-testing/geos-2.2.3/source/index/strtree/AbstractNode.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/strtree/AbstractSTRtree.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/strtree/Interval.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/strtree/ItemBoundable.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/strtree/SIRtree.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/strtree/STRtree.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/sweepline/ trunk/toolkits/basemap-testing/geos-2.2.3/source/index/sweepline/SweepLineIndex.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/sweepline/SweepLineInterval.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/index/sweepline/indexSweepLineEvent.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/ trunk/toolkits/basemap-testing/geos-2.2.3/source/io/ByteOrderValues.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/ParseException.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/StringTokenizer.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/Unload.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/WKBReader.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/WKBWriter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/WKTReader.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/WKTWriter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/Writer.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/markup/ trunk/toolkits/basemap-testing/geos-2.2.3/source/io/markup/MarkupSTL.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/io/markup/MarkupSTL.h trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/ trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/IteratedNoder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/MCQuadtreeNoder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/Noder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/NodingValidator.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/SegmentNode.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/SegmentNodeList.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/SegmentString.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/SimpleNoder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/nodingSegmentIntersector.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/snapround/ trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/snapround/SegmentSnapper.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/snapround/SimpleSegmentStringsSnapper.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/noding/snapround/SnapRounder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/GeometryGraphOperation.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/IsSimpleOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/BufferBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/BufferOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/BufferSubgraph.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/OffsetCurveBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/OffsetCurveSetBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/RightmostEdgeFinder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/buffer/SubgraphDepthLocater.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/distance/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/distance/ConnectedElementLocationFilter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/distance/ConnectedElementPointFilter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/distance/DistanceOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/distance/GeometryLocation.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/linemerge/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/linemerge/EdgeString.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/linemerge/LineMergeDirectedEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/linemerge/LineMergeEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/linemerge/LineMergeGraph.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/linemerge/LineMerger.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/EdgeSetNoder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/ElevationMatrix.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/ElevationMatrixCell.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/ElevationMatrixFilter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/LineBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/MaximalEdgeRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/MinimalEdgeRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/OverlayNodeFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/OverlayOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/PointBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/overlay/PolygonBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/polygonize/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/polygonize/PolygonizeDirectedEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/polygonize/PolygonizeEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/polygonize/PolygonizeGraph.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/polygonize/Polygonizer.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/polygonize/polygonizeEdgeRing.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/EdgeEndBuilder.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/EdgeEndBundle.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/EdgeEndBundleStar.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/RelateComputer.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/RelateNode.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/RelateNodeFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/RelateNodeGraph.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/relate/RelateOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/ trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/ConnectedInteriorTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/ConsistentAreaTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/IsValidOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/QuadtreeNestedRingTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/RepeatedPointTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/SimpleNestedRingTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/SweeplineNestedRingTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/operation/valid/TopologyValidationError.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/ trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/planarDirectedEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/planarDirectedEdgeStar.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/planarEdge.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/planarGraphComponent.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/planarNode.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/planarNodeMap.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/planargraph/planarPlanarGraph.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/precision/ trunk/toolkits/basemap-testing/geos-2.2.3/source/precision/CommonBits.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/precision/CommonBitsOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/precision/CommonBitsRemover.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/precision/EnhancedPrecisionOp.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/precision/SimpleGeometryPrecisionReducer.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/test/ trunk/toolkits/basemap-testing/geos-2.2.3/source/test/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/source/test/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/source/test/SimpleWKTTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/test/XMLTester.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/test/XMLTester.h trunk/toolkits/basemap-testing/geos-2.2.3/source/test/test.xml trunk/toolkits/basemap-testing/geos-2.2.3/source/util/ trunk/toolkits/basemap-testing/geos-2.2.3/source/util/Assert.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/AssertionFailedException.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/CoordinateArrayFiter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/GEOSException.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/GeometricShapeFactory.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/IllegalArgumentException.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/Profiler.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/UniqueCoordinateArrayFilter.cpp trunk/toolkits/basemap-testing/geos-2.2.3/source/util/UnsupportedOperationException.cpp trunk/toolkits/basemap-testing/geos-2.2.3/swig/ trunk/toolkits/basemap-testing/geos-2.2.3/swig/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/swig/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/swig/README.txt trunk/toolkits/basemap-testing/geos-2.2.3/swig/geos.i trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/ trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/README.txt trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/setup.py trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/ trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/TESTING.txt trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/cases/ trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/cases/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/cases/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/cases/__init__.py trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/cases/pointtest.py trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/cases/testing.py trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/cases/wkttest.py trunk/toolkits/basemap-testing/geos-2.2.3/swig/python/tests/runtests.py trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/ trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/README.txt trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/ruby.i trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/ trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/example.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/geos_tests.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_combinations.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_envelope.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_factory_methods.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_geom.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_helper.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_io.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_operations.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_relations.rb trunk/toolkits/basemap-testing/geos-2.2.3/swig/ruby/test/test_simple.rb trunk/toolkits/basemap-testing/geos-2.2.3/tools/ trunk/toolkits/basemap-testing/geos-2.2.3/tools/Makefile.am trunk/toolkits/basemap-testing/geos-2.2.3/tools/Makefile.in trunk/toolkits/basemap-testing/geos-2.2.3/tools/geos-config.in Modified: trunk/toolkits/basemap-testing/README =================================================================== --- trunk/toolkits/basemap-testing/README 2007-11-14 19:43:31 UTC (rev 4290) +++ trunk/toolkits/basemap-testing/README 2007-11-14 19:45:49 UTC (rev 4291) @@ -9,13 +9,18 @@ numpy 1.0 (or higher) -libgoes_c version 2.2.3, available from http://geos.refractions.net/. +The GEOS (Geometry Engine - Open Source) library (version 2.2.3). +Source code is included in the geos-2.2.3 directory. **Copyright** source code from proj.4 (http://proj.maptools.org) is included in the -'src' directory (under the terms given in LICENSE_proj4). +'src' directory under the terms given in LICENSE_proj4. +source code for the GEOS library is +included in the 'geos-2.2.3' directory under the terms given in +geos-2.2.3/COPYING. + pyshapelib by Bernhard Herzog is included in the 'pyshapelib' directory under the terms given in LICENSE_pyshapelib. @@ -57,15 +62,27 @@ **Install** -First, install pre-requisites (see **Requirements** above). +0) Install pre-requisite python modules numpy and matplotlib. -Then download basemap-X.Y.Z.tar.gz from +1) Then download basemap-X.Y.Z.tar.gz from the sourceforge download site, unpack and cd to basemap-X.Y.Z. -Set the environment variable GEOS_DIR to point to the location + +2) Install the GEOS library. If you already have it on your +system, just set the environment variable GEOS_DIR to point to the location of libgeos_c and geos_c.h (if libgeos_c is in /usr/local/lib and geos_c.h is in /usr/local/include, set GEOS_DIR to /usr/local). -Then run 'python setup.py install'. +Then go to step (3). If you don't have it, you can build it from +the source code included with basemap by following these steps: + > cd geos-2.2.3 + > export GEOS_DIR=<where you want the libs and headers to go> + A reasonable choice on a Unix-like system is /usr/local, or + if you don't have permission to write there, your home directory. + > make; make install + +3) cd back to the top level basemap directory (basemap-X.Y.Z) and +run the usual 'python setup.py install'. + **Contact** Jeff Whitaker <jef...@no...> Added: trunk/toolkits/basemap-testing/geos-2.2.3/AUTHORS =================================================================== --- trunk/toolkits/basemap-testing/geos-2.2.3/AUTHORS (rev 0) +++ trunk/toolkits/basemap-testing/geos-2.2.3/AUTHORS 2007-11-14 19:45:49 UTC (rev 4291) @@ -0,0 +1,23 @@ +2003-11-06 + +Development of GEOS was funded by: + + Vivid Solutions Inc (www.vividsolutions.com) + Refractions Research Inc (www.refractions.net) + British Columbia Advanced Systems Institute (www.asi.bc.ca) + +GEOS is based on algorithms originally developed in Java +by Martin Davis (mb...@vi...) in the +JTS Topology Suite (www.vividsolutions.com/jts/jtshome.htm) + +Developers: + + Yury Bychkov (me...@yu...) - Initial Porting + Sandro Santilli (st...@ke...) - Bug Fixing / Maintenance + Martin Davis (mb...@vi...) - Architecture + Dave Blasby (db...@re...) - PostGIS Connectivity + Norman Vine (nv...@ca...) - Porting / C++ Expertise + Fernando Villa (fv...@zo...) - GNU Build System + Paul Ramsey (pr...@re...) - Coordination / Build + Sean Gillies (sgi...@fr...) - Scripting Interface + Added: trunk/toolkits/basemap-testing/geos-2.2.3/COPYING =================================================================== --- trunk/toolkits/basemap-testing/geos-2.2.3/COPYING (rev 0) +++ trunk/toolkits/basemap-testing/geos-2.2.3/COPYING 2007-11-14 19:45:49 UTC (rev 4291) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + Added: trunk/toolkits/basemap-testing/geos-2.2.3/ChangeLog =================================================================== --- trunk/toolkits/basemap-testing/geos-2.2.3/ChangeLog (rev 0) +++ trunk/toolkits/basemap-testing/geos-2.2.3/ChangeLog 2007-11-14 19:45:49 UTC (rev 4291) @@ -0,0 +1,259 @@ +2006-05-17 10:07 strk + + * NEWS: Added note about win32 SDK support + +2006-05-16 16:38 strk + + * source/headers/geos/opValid.h: Gave error enum a name and renamed + ERROR to eError (to avoid clash with win32 headers) + +2006-05-02 16:44 hobu + + * source/capi/geos_c.h.vc: use 1.1.0 as CAPI version + +2006-05-02 16:04 strk + + * source/io/WKBReader.cpp: Use tabs for indenting + +2006-05-01 17:22 sgillies + + * source/io/WKBReader.cpp: Fix for WKB parsing... [truncated message content] |
From: <js...@us...> - 2007-11-14 19:48:49
|
Revision: 4293 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4293&view=rev Author: jswhit Date: 2007-11-14 11:48:38 -0800 (Wed, 14 Nov 2007) Log Message: ----------- update install instructions, include GEOS source in MANIFEST Modified Paths: -------------- trunk/toolkits/basemap-testing/MANIFEST.in trunk/toolkits/basemap-testing/README Modified: trunk/toolkits/basemap-testing/MANIFEST.in =================================================================== --- trunk/toolkits/basemap-testing/MANIFEST.in 2007-11-14 19:46:37 UTC (rev 4292) +++ trunk/toolkits/basemap-testing/MANIFEST.in 2007-11-14 19:48:38 UTC (rev 4293) @@ -78,3 +78,4 @@ include lib/matplotlib/toolkits/basemap/data/*_l.dat include lib/matplotlib/toolkits/basemap/data/*_i.dat include lib/matplotlib/toolkits/basemap/data/*_h.dat +recursive-include geos-2.2.3 * Modified: trunk/toolkits/basemap-testing/README =================================================================== --- trunk/toolkits/basemap-testing/README 2007-11-14 19:46:37 UTC (rev 4292) +++ trunk/toolkits/basemap-testing/README 2007-11-14 19:48:38 UTC (rev 4293) @@ -78,6 +78,7 @@ > export GEOS_DIR=<where you want the libs and headers to go> A reasonable choice on a Unix-like system is /usr/local, or if you don't have permission to write there, your home directory. + > ./configure --prefix=$GEOS_DIR > make; make install 3) cd back to the top level basemap directory (basemap-X.Y.Z) and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-15 21:06:16
|
Revision: 4322 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4322&view=rev Author: jswhit Date: 2007-11-15 13:06:14 -0800 (Thu, 15 Nov 2007) Log Message: ----------- add GEOS License (LGPL). Modified Paths: -------------- trunk/toolkits/basemap-testing/README Added Paths: ----------- trunk/toolkits/basemap-testing/LICENSE_geos Added: trunk/toolkits/basemap-testing/LICENSE_geos =================================================================== --- trunk/toolkits/basemap-testing/LICENSE_geos (rev 0) +++ trunk/toolkits/basemap-testing/LICENSE_geos 2007-11-15 21:06:14 UTC (rev 4322) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + Modified: trunk/toolkits/basemap-testing/README =================================================================== --- trunk/toolkits/basemap-testing/README 2007-11-15 21:00:07 UTC (rev 4321) +++ trunk/toolkits/basemap-testing/README 2007-11-15 21:06:14 UTC (rev 4322) @@ -19,7 +19,7 @@ source code for the GEOS library is included in the 'geos-2.2.3' directory under the terms given in -geos-2.2.3/COPYING. +LICENSE_geos. pyshapelib by Bernhard Herzog is included in the 'pyshapelib' directory under the terms given in LICENSE_pyshapelib. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-16 15:54:01
|
Revision: 4332 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4332&view=rev Author: jswhit Date: 2007-11-16 07:53:50 -0800 (Fri, 16 Nov 2007) Log Message: ----------- added NetCDF reader to basemap namespace (from matplotlib.toolkits.basemap import NetCDFFile) Modified Paths: -------------- trunk/toolkits/basemap-testing/MANIFEST.in trunk/toolkits/basemap-testing/examples/ccsm_popgrid.py trunk/toolkits/basemap-testing/examples/plotprecip.py trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap-testing/MANIFEST.in =================================================================== --- trunk/toolkits/basemap-testing/MANIFEST.in 2007-11-16 13:46:59 UTC (rev 4331) +++ trunk/toolkits/basemap-testing/MANIFEST.in 2007-11-16 15:53:50 UTC (rev 4332) @@ -54,7 +54,6 @@ include examples/setwh.py include examples/ccsm_popgrid.py include examples/ccsm_popgrid.nc -include examples/pupynere.py include examples/plot_tissot.py include examples/tissot.dbf include examples/tissot.shp @@ -69,6 +68,7 @@ include lib/matplotlib/toolkits/basemap/proj.py include lib/matplotlib/toolkits/basemap/pyproj.py include lib/matplotlib/toolkits/basemap/cm.py +include lib/matplotlib/toolkits/basemap/pupynere.py include pyshapelib/README pyshapelib/COPYING pyshapelib/ChangeLog pyshapelib/NEWS include pyshapelib/*.i pyshapelib/*.c pyshapelib/*.py pyshapelib/*.h include pyshapelib/*.shp pyshapelib/*.shx pyshapelib/*.dbf Modified: trunk/toolkits/basemap-testing/examples/ccsm_popgrid.py =================================================================== --- trunk/toolkits/basemap-testing/examples/ccsm_popgrid.py 2007-11-16 13:46:59 UTC (rev 4331) +++ trunk/toolkits/basemap-testing/examples/ccsm_popgrid.py 2007-11-16 15:53:50 UTC (rev 4332) @@ -24,7 +24,6 @@ from Roberto De Almeida for reading netCDF files (included). """ -from pupynere import NetCDFFile import pylab as pl from matplotlib import rcParams try: @@ -34,7 +33,7 @@ raise ImportError('this example requires numpy') import matplotlib.numerix.ma as MA import matplotlib.numerix as N -from matplotlib.toolkits.basemap import Basemap +from matplotlib.toolkits.basemap import Basemap, NetCDFFile # read in data from netCDF file. infile = 'ccsm_popgrid.nc' Modified: trunk/toolkits/basemap-testing/examples/plotprecip.py =================================================================== --- trunk/toolkits/basemap-testing/examples/plotprecip.py 2007-11-16 13:46:59 UTC (rev 4331) +++ trunk/toolkits/basemap-testing/examples/plotprecip.py 2007-11-16 15:53:50 UTC (rev 4332) @@ -1,5 +1,4 @@ -from pupynere import NetCDFFile -from matplotlib.toolkits.basemap import Basemap, cm +from matplotlib.toolkits.basemap import Basemap, cm, NetCDFFile import pylab, copy from matplotlib import rcParams Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/__init__.py 2007-11-16 13:46:59 UTC (rev 4331) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/__init__.py 2007-11-16 15:53:50 UTC (rev 4332) @@ -1,2 +1,3 @@ from basemap import __doc__, __version__ from basemap import * +from pupynere import NetCDFFile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-16 15:54:42
|
Revision: 4334 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4334&view=rev Author: jswhit Date: 2007-11-16 07:54:31 -0800 (Fri, 16 Nov 2007) Log Message: ----------- move pupynere.py Added Paths: ----------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/pupynere.py Removed Paths: ------------- trunk/toolkits/basemap-testing/examples/pupynere.py Deleted: trunk/toolkits/basemap-testing/examples/pupynere.py =================================================================== --- trunk/toolkits/basemap-testing/examples/pupynere.py 2007-11-16 15:53:57 UTC (rev 4333) +++ trunk/toolkits/basemap-testing/examples/pupynere.py 2007-11-16 15:54:31 UTC (rev 4334) @@ -1,251 +0,0 @@ -"""NetCDF reader. - -Pupynere implements a PUre PYthon NEtcdf REader. -""" - -__author__ = "Roberto De Almeida <ro...@py...>" - - -import struct -import itertools -import mmap - -from numpy import ndarray, zeros, array - - -ABSENT = '\x00' * 8 -ZERO = '\x00' * 4 -NC_BYTE = '\x00\x00\x00\x01' -NC_CHAR = '\x00\x00\x00\x02' -NC_SHORT = '\x00\x00\x00\x03' -NC_INT = '\x00\x00\x00\x04' -NC_FLOAT = '\x00\x00\x00\x05' -NC_DOUBLE = '\x00\x00\x00\x06' -NC_DIMENSION = '\x00\x00\x00\n' -NC_VARIABLE = '\x00\x00\x00\x0b' -NC_ATTRIBUTE = '\x00\x00\x00\x0c' - - -class NetCDFFile(object): - """A NetCDF file parser.""" - - def __init__(self, file): - self._buffer = open(file, 'rb') - self._parse() - - def read(self, size=-1): - """Alias for reading the file buffer.""" - return self._buffer.read(size) - - def _parse(self): - """Initial parsing of the header.""" - # Check magic bytes. - assert self.read(3) == 'CDF' - - # Read version byte. - byte = self.read(1) - self.version_byte = struct.unpack('>b', byte)[0] - - # Read header info. - self._numrecs() - self._dim_array() - self._gatt_array() - self._var_array() - - def _numrecs(self): - """Read number of records.""" - self._nrecs = self._unpack_int() - - def _dim_array(self): - """Read a dict with dimensions names and sizes.""" - assert self.read(4) in [ZERO, NC_DIMENSION] - count = self._unpack_int() - - self.dimensions = {} - self._dims = [] - for dim in range(count): - name = self._read_string() - length = self._unpack_int() - if length == 0: length = None # record dimension - self.dimensions[name] = length - self._dims.append(name) # preserve dim order - - def _gatt_array(self): - """Read global attributes.""" - self.attributes = self._att_array() - - # Update __dict__ for compatibility with S.IO.N - self.__dict__.update(self.attributes) - - def _att_array(self): - """Read a dict with attributes.""" - assert self.read(4) in [ZERO, NC_ATTRIBUTE] - count = self._unpack_int() - - # Read attributes. - attributes = {} - for attribute in range(count): - name = self._read_string() - nc_type = self._unpack_int() - n = self._unpack_int() - - # Read value for attributes. - attributes[name] = self._read_values(n, nc_type) - - return attributes - - def _var_array(self): - """Read all variables.""" - assert self.read(4) in [ZERO, NC_VARIABLE] - - # Read size of each record, in bytes. - self._read_recsize() - - # Read variables. - self.variables = {} - count = self._unpack_int() - for variable in range(count): - name = self._read_string() - self.variables[name] = self._read_var() - - def _read_recsize(self): - """Read all variables and compute record bytes.""" - pos = self._buffer.tell() - - recsize = 0 - count = self._unpack_int() - for variable in range(count): - name = self._read_string() - n = self._unpack_int() - isrec = False - for i in range(n): - dimid = self._unpack_int() - name = self._dims[dimid] - dim = self.dimensions[name] - if dim is None and i == 0: - isrec = True - attributes = self._att_array() - nc_type = self._unpack_int() - vsize = self._unpack_int() - begin = [self._unpack_int, self._unpack_int64][self.version_byte-1]() - - if isrec: recsize += vsize - - self._recsize = recsize - self._buffer.seek(pos) - - def _read_var(self): - dimensions = [] - shape = [] - n = self._unpack_int() - isrec = False - for i in range(n): - dimid = self._unpack_int() - name = self._dims[dimid] - dimensions.append(name) - dim = self.dimensions[name] - if dim is None and i == 0: - dim = self._nrecs - isrec = True - shape.append(dim) - dimensions = tuple(dimensions) - shape = tuple(shape) - - attributes = self._att_array() - nc_type = self._unpack_int() - vsize = self._unpack_int() - - # Read offset. - begin = [self._unpack_int, self._unpack_int64][self.version_byte-1]() - - return NetCDFVariable(self._buffer.fileno(), nc_type, vsize, begin, shape, dimensions, attributes, isrec, self._recsize) - - def _read_values(self, n, nc_type): - bytes = [1, 1, 2, 4, 4, 8] - typecodes = ['b', 'c', 'h', 'i', 'f', 'd'] - - count = n * bytes[nc_type-1] - values = self.read(count) - padding = self.read((4 - (count % 4)) % 4) - - typecode = typecodes[nc_type-1] - if nc_type != 2: # not char - values = struct.unpack('>%s' % (typecode * n), values) - values = array(values, dtype=typecode) - else: - # Remove EOL terminator. - if values.endswith('\x00'): values = values[:-1] - - return values - - def _unpack_int(self): - return struct.unpack('>i', self.read(4))[0] - _unpack_int32 = _unpack_int - - def _unpack_int64(self): - return struct.unpack('>q', self.read(8))[0] - - def _read_string(self): - count = struct.unpack('>i', self.read(4))[0] - s = self.read(count) - # Remove EOL terminator. - if s.endswith('\x00'): s = s[:-1] - padding = self.read((4 - (count % 4)) % 4) - return s - - def close(self): - self._buffer.close() - - -class NetCDFVariable(object): - def __init__(self, fileno, nc_type, vsize, begin, shape, dimensions, attributes, isrec=False, recsize=0): - self._nc_type = nc_type - self._vsize = vsize - self._begin = begin - self.shape = shape - self.dimensions = dimensions - self.attributes = attributes # for ``dap.plugins.netcdf`` - self.__dict__.update(attributes) - self._is_record = isrec - - # Number of bytes and type. - self._bytes = [1, 1, 2, 4, 4, 8][self._nc_type-1] - type_ = ['i', 'S', 'i', 'i', 'f', 'f'][self._nc_type-1] - dtype = '>%s%d' % (type_, self._bytes) - bytes = self._begin + self._vsize - - if isrec: - # Record variables are not stored contiguosly on disk, so we - # need to create a separate array for each record. - self.__array_data__ = zeros(shape, dtype) - bytes += (shape[0] - 1) * recsize - for n in range(shape[0]): - offset = self._begin + (n * recsize) - mm = mmap.mmap(fileno, bytes, access=mmap.ACCESS_READ) - self.__array_data__[n] = ndarray.__new__(ndarray, shape[1:], dtype=dtype, buffer=mm, offset=offset, order=0) - else: - # Create buffer and data. - mm = mmap.mmap(fileno, bytes, access=mmap.ACCESS_READ) - self.__array_data__ = ndarray.__new__(ndarray, shape, dtype=dtype, buffer=mm, offset=self._begin, order=0) - - # N-D array interface - self.__array_interface__ = {'shape' : shape, - 'typestr': dtype, - 'data' : self.__array_data__, - 'version': 3, - } - - def __getitem__(self, index): - return self.__array_data__.__getitem__(index) - - def getValue(self): - """For scalars.""" - return self.__array_data__.item() - - def typecode(self): - return ['b', 'c', 'h', 'i', 'f', 'd'][self._nc_type-1] - - -def _test(): - import doctest - doctest.testmod() Added: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/pupynere.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/pupynere.py (rev 0) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/pupynere.py 2007-11-16 15:54:31 UTC (rev 4334) @@ -0,0 +1,272 @@ +"""NetCDF reader. + +Pupynere implements a PUre PYthon NEtcdf REader. + +Copyright (c) 2003-2006 Roberto De Almeida <ro...@py...> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject +to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" + +__author__ = "Roberto De Almeida <ro...@py...>" + + +import struct +import itertools +import mmap + +from numpy import ndarray, zeros, array + + +ABSENT = '\x00' * 8 +ZERO = '\x00' * 4 +NC_BYTE = '\x00\x00\x00\x01' +NC_CHAR = '\x00\x00\x00\x02' +NC_SHORT = '\x00\x00\x00\x03' +NC_INT = '\x00\x00\x00\x04' +NC_FLOAT = '\x00\x00\x00\x05' +NC_DOUBLE = '\x00\x00\x00\x06' +NC_DIMENSION = '\x00\x00\x00\n' +NC_VARIABLE = '\x00\x00\x00\x0b' +NC_ATTRIBUTE = '\x00\x00\x00\x0c' + + +class NetCDFFile(object): + """A NetCDF file parser.""" + + def __init__(self, file): + self._buffer = open(file, 'rb') + self._parse() + + def read(self, size=-1): + """Alias for reading the file buffer.""" + return self._buffer.read(size) + + def _parse(self): + """Initial parsing of the header.""" + # Check magic bytes. + assert self.read(3) == 'CDF' + + # Read version byte. + byte = self.read(1) + self.version_byte = struct.unpack('>b', byte)[0] + + # Read header info. + self._numrecs() + self._dim_array() + self._gatt_array() + self._var_array() + + def _numrecs(self): + """Read number of records.""" + self._nrecs = self._unpack_int() + + def _dim_array(self): + """Read a dict with dimensions names and sizes.""" + assert self.read(4) in [ZERO, NC_DIMENSION] + count = self._unpack_int() + + self.dimensions = {} + self._dims = [] + for dim in range(count): + name = self._read_string() + length = self._unpack_int() + if length == 0: length = None # record dimension + self.dimensions[name] = length + self._dims.append(name) # preserve dim order + + def _gatt_array(self): + """Read global attributes.""" + self.attributes = self._att_array() + + # Update __dict__ for compatibility with S.IO.N + self.__dict__.update(self.attributes) + + def _att_array(self): + """Read a dict with attributes.""" + assert self.read(4) in [ZERO, NC_ATTRIBUTE] + count = self._unpack_int() + + # Read attributes. + attributes = {} + for attribute in range(count): + name = self._read_string() + nc_type = self._unpack_int() + n = self._unpack_int() + + # Read value for attributes. + attributes[name] = self._read_values(n, nc_type) + + return attributes + + def _var_array(self): + """Read all variables.""" + assert self.read(4) in [ZERO, NC_VARIABLE] + + # Read size of each record, in bytes. + self._read_recsize() + + # Read variables. + self.variables = {} + count = self._unpack_int() + for variable in range(count): + name = self._read_string() + self.variables[name] = self._read_var() + + def _read_recsize(self): + """Read all variables and compute record bytes.""" + pos = self._buffer.tell() + + recsize = 0 + count = self._unpack_int() + for variable in range(count): + name = self._read_string() + n = self._unpack_int() + isrec = False + for i in range(n): + dimid = self._unpack_int() + name = self._dims[dimid] + dim = self.dimensions[name] + if dim is None and i == 0: + isrec = True + attributes = self._att_array() + nc_type = self._unpack_int() + vsize = self._unpack_int() + begin = [self._unpack_int, self._unpack_int64][self.version_byte-1]() + + if isrec: recsize += vsize + + self._recsize = recsize + self._buffer.seek(pos) + + def _read_var(self): + dimensions = [] + shape = [] + n = self._unpack_int() + isrec = False + for i in range(n): + dimid = self._unpack_int() + name = self._dims[dimid] + dimensions.append(name) + dim = self.dimensions[name] + if dim is None and i == 0: + dim = self._nrecs + isrec = True + shape.append(dim) + dimensions = tuple(dimensions) + shape = tuple(shape) + + attributes = self._att_array() + nc_type = self._unpack_int() + vsize = self._unpack_int() + + # Read offset. + begin = [self._unpack_int, self._unpack_int64][self.version_byte-1]() + + return NetCDFVariable(self._buffer.fileno(), nc_type, vsize, begin, shape, dimensions, attributes, isrec, self._recsize) + + def _read_values(self, n, nc_type): + bytes = [1, 1, 2, 4, 4, 8] + typecodes = ['b', 'c', 'h', 'i', 'f', 'd'] + + count = n * bytes[nc_type-1] + values = self.read(count) + padding = self.read((4 - (count % 4)) % 4) + + typecode = typecodes[nc_type-1] + if nc_type != 2: # not char + values = struct.unpack('>%s' % (typecode * n), values) + values = array(values, dtype=typecode) + else: + # Remove EOL terminator. + if values.endswith('\x00'): values = values[:-1] + + return values + + def _unpack_int(self): + return struct.unpack('>i', self.read(4))[0] + _unpack_int32 = _unpack_int + + def _unpack_int64(self): + return struct.unpack('>q', self.read(8))[0] + + def _read_string(self): + count = struct.unpack('>i', self.read(4))[0] + s = self.read(count) + # Remove EOL terminator. + if s.endswith('\x00'): s = s[:-1] + padding = self.read((4 - (count % 4)) % 4) + return s + + def close(self): + self._buffer.close() + + +class NetCDFVariable(object): + def __init__(self, fileno, nc_type, vsize, begin, shape, dimensions, attributes, isrec=False, recsize=0): + self._nc_type = nc_type + self._vsize = vsize + self._begin = begin + self.shape = shape + self.dimensions = dimensions + self.attributes = attributes # for ``dap.plugins.netcdf`` + self.__dict__.update(attributes) + self._is_record = isrec + + # Number of bytes and type. + self._bytes = [1, 1, 2, 4, 4, 8][self._nc_type-1] + type_ = ['i', 'S', 'i', 'i', 'f', 'f'][self._nc_type-1] + dtype = '>%s%d' % (type_, self._bytes) + bytes = self._begin + self._vsize + + if isrec: + # Record variables are not stored contiguosly on disk, so we + # need to create a separate array for each record. + self.__array_data__ = zeros(shape, dtype) + bytes += (shape[0] - 1) * recsize + for n in range(shape[0]): + offset = self._begin + (n * recsize) + mm = mmap.mmap(fileno, bytes, access=mmap.ACCESS_READ) + self.__array_data__[n] = ndarray.__new__(ndarray, shape[1:], dtype=dtype, buffer=mm, offset=offset, order=0) + else: + # Create buffer and data. + mm = mmap.mmap(fileno, bytes, access=mmap.ACCESS_READ) + self.__array_data__ = ndarray.__new__(ndarray, shape, dtype=dtype, buffer=mm, offset=self._begin, order=0) + + # N-D array interface + self.__array_interface__ = {'shape' : shape, + 'typestr': dtype, + 'data' : self.__array_data__, + 'version': 3, + } + + def __getitem__(self, index): + return self.__array_data__.__getitem__(index) + + def getValue(self): + """For scalars.""" + return self.__array_data__.item() + + def typecode(self): + return ['b', 'c', 'h', 'i', 'f', 'd'][self._nc_type-1] + + +def _test(): + import doctest + doctest.testmod() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-17 18:27:30
|
Revision: 4363 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4363&view=rev Author: jswhit Date: 2007-11-17 10:27:29 -0800 (Sat, 17 Nov 2007) Log Message: ----------- stuff for basemap-data-fullres package Modified Paths: -------------- trunk/toolkits/basemap-testing/setup-data.py Added Paths: ----------- trunk/toolkits/basemap-testing/MANIFEST-data.in trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/__init__.py Added: trunk/toolkits/basemap-testing/MANIFEST-data.in =================================================================== --- trunk/toolkits/basemap-testing/MANIFEST-data.in (rev 0) +++ trunk/toolkits/basemap-testing/MANIFEST-data.in 2007-11-17 18:27:29 UTC (rev 4363) @@ -0,0 +1,12 @@ +include MANIFEST-data.in +include README +include setup-data.py +include lib/matplotlib/toolkits/basemap/data/__init__.py +include lib/matplotlib/toolkits/basemap/data/countries_f.dat +include lib/matplotlib/toolkits/basemap/data/countriesmeta_f.dat +include lib/matplotlib/toolkits/basemap/data/gshhs_f.dat +include lib/matplotlib/toolkits/basemap/data/gshhsmeta_f.dat +include lib/matplotlib/toolkits/basemap/data/rivers_f.dat +include lib/matplotlib/toolkits/basemap/data/riversmeta_f.dat +include lib/matplotlib/toolkits/basemap/data/states_f.dat +include lib/matplotlib/toolkits/basemap/data/statesmeta_f.dat Added: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/data/__init__.py =================================================================== Modified: trunk/toolkits/basemap-testing/setup-data.py =================================================================== --- trunk/toolkits/basemap-testing/setup-data.py 2007-11-17 18:11:07 UTC (rev 4362) +++ trunk/toolkits/basemap-testing/setup-data.py 2007-11-17 18:27:29 UTC (rev 4363) @@ -8,12 +8,11 @@ else: additional_params = {} from distutils.core import setup -packages = ['matplotlib.toolkits.basemap'] +packages = ['matplotlib.toolkits.basemap.data'] package_dirs = {'':'lib'} boundaryfiles = glob.glob("lib/matplotlib/toolkits/basemap/data/*_f.dat") basemap_datafiles = [os.path.join('data',os.path.basename(bfile)) for bfile in boundaryfiles] -package_data = {'matplotlib.toolkits.basemap':basemap_datafiles} -print package_data +package_data = {'matplotlib.toolkits.basemap.data':basemap_datafiles} setup( name = "basemap-data-fullres", version = "0.9.7", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |