{ "info": { "author": "Steve Lime", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: C", "Programming Language :: C++", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: GIS", "Topic :: Scientific/Engineering :: Information Analysis" ], "description": "Python MapScript for MapServer 7.4.0 README\r\n===========================================\r\n\r\n:Author: MapServer Team\r\n:Last Updated: 2019-06-04\r\n\r\nIntroduction\r\n------------\r\n\r\nThe Python mapscript module provides users an interface to `MapServer `_\r\nclasses on any platform, and has been tested on Python versions 2.7 and 3.5+. \r\n\r\nThe Python mapscript module is created using `SWIG `_ the\r\nthe Simplified Wrapper and Interface Generator. This is used to create MapServer bindings in\r\nmany different programming languages. \r\n\r\n+ Language agnostic documentation is available at http://mapserver.org/mapscript/introduction.html\r\n+ Python specific documentation is available at http://mapserver.org/mapscript/python.html\r\n\r\nFor working with Mapfiles in Python the `mappyfile `_ project is \r\nalso available, this allows creating, parsing, formatting, and validating Mapfiles without any dependencies on MapServer. \r\n\r\nWheels and PyPI\r\n---------------\r\n\r\nPython `wheels `_ have been created for Windows and uploaded to \r\n`PyPI `_ - the Python Package Index. Note - MapServer binaries still need to be installed on the system, \r\nand are not included in the wheel itself, see the *Installation* section below. \r\n\r\nAdvantages of ready-made wheels on PyPI include:\r\n\r\n+ easy installation using `pip `_\r\n+ mapscript can be added as a dependency to `Requirements Files `_\r\n+ mapscript can be easily added to a Python `Virtual Environment `_\r\n+ Python2 or Python3 versions of mapscript can be installed and work with a single installation of MapServer\r\n\r\nCurrently the following wheels are built:\r\n\r\n+ Python 2.7 x64 for MapServer 7.4.0\r\n+ Python 3.6 x64 for MapServer 7.4.0\r\n\r\nThe mapscript wheels have been compiled using Visual Studio 2017 version 15.3 (``MSVC++ 14.11 _MSC_VER == 1911``). \r\nLinux wheels are also planned, using the `manylinux `_ project. \r\n\r\nNo source distributions will be provided on PyPI - to build from source requires the full MapServer source code,\r\nin which case it is easiest to take a copy of the full MapServer project and run the CMake process detailed below. \r\n\r\nThe wheels contain a full test suite and sample data that can be run to check that the installed MapServer is\r\nrunning correctly. \r\n\r\n..\r\n py3 SWIG flag adds type annotations\r\n\r\nInstallation on Windows\r\n-----------------------\r\n\r\nTo use mapscript you will need to add the MapServer binaries to your system path. \r\nOn Windows you can use the following, replacing ``C:\\MapServer\\bin`` with the location of your MapServer binaries. \r\n\r\n.. code-block:: bat\r\n\r\n SET PATH=C:\\MapServer\\bin;%PATH%\r\n\r\nWindows binary packages can be downloaded from `GIS Internals `_. \r\nTo ensure compatibility with the wheels, please use identical release packages, e.g. ``release-1911-x64-gdal-2-3-mapserver-7-4``\r\nfor mapscript 7.4. \r\n\r\nWhen using these packages the MapServer path will be similar to ``C:\\release-1911-x64-gdal-2-3-mapserver-7-2\\bin``. \r\n\r\nPrior to installing mapscript it is recommended to update pip to the latest version with the following command:\r\n\r\n.. code-block:: bat\r\n\r\n python -m pip install --upgrade pip\r\n\r\nIf there are binary wheels available for your system, mapscript can be installed using:\r\n\r\n.. code-block:: bat\r\n\r\n pip install mapscript\r\n\r\nIf you already have mapscript installed and wish to upgrade it to a newer version you can use:\r\n\r\n.. code-block:: bat\r\n\r\n pip install mapscript --upgrade\r\n\r\nNow you should be able to import mapscript:\r\n\r\n.. code-block:: python\r\n\r\n python -c \"import mapscript;print(mapscript.msGetVersion())\"\r\n MapServer version 7.4.0 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE\r\n\r\nIf you failed to add the MapServer binaries to your system path you may see one of the following errors:\r\n\r\n.. code-block:: python\r\n\r\n ImportError: No module named _mapscript # Python 2.x\r\n ModuleNotFoundError: No module named '_mapscript' # Python 3.x\r\n\r\nIf your version of mapscript does not match your version of MapServer you may instead one of the following messages:\r\n\r\n.. code-block:: python\r\n\r\n ImportError: DLL load failed: The specified module could not be found.\r\n ImportError: DLL load failed: The specified procedure could not be found.\r\n\r\nInstallation on Unix\r\n--------------------\r\n\r\nFor Unix users there are two approaches to installing mapscript. The first is to install the ``python-mapscript`` package using a package manager. For example on\r\nUbuntu the following command can be used:\r\n\r\n.. code-block:: bat\r\n\r\n sudo apt-get install python-mapscript\r\n\r\nThe second approach is to build and install the Python mapscript module from source. Full details on compiling MapServer from source are detailed on the\r\n`Compiling on Unix `_ page. To make sure Python mapscript is built alongside MapServer the following flag needs to be set:\r\n\r\n.. code-block:: bat\r\n\r\n -DWITH_PYTHON=ON\r\n\r\nTo configure the path of the mapscript installation location ``-DCMAKE_INSTALL_PREFIX`` can be set, e.g. \r\n\r\n.. code-block:: bat\r\n\r\n sudo cmake .. -DCMAKE_INSTALL_PREFIX=/usr\r\n\r\nWhen installing the `DESTDIR `_ variable can be set (note ``DESTDIR`` is not used on Windows)\r\nto install mapscript to a non-default location. E.g.\r\n\r\n.. code-block:: bat\r\n\r\n make install DESTDIR=/tmp\r\n\r\nIn summary the ``install`` target runs the ``setup.py install`` command using custom paths (when set) similar to below:\r\n\r\n python setup.py install --root=${DESTDIR} --prefix={CMAKE_INSTALL_PREFIX}\r\n\r\nQuickstart\r\n----------\r\n\r\nSome basic examples of what can be done with mapscript are shown below. Note - before running any scripts using mapscript, \r\nyou will need to add the MapServer binaries to your system path, see the *Installation* section above. \r\n\r\nTo open an existing Mapfile:\r\n\r\n.. code-block:: python\r\n\r\n >>> import mapscript\r\n >>> test_map = mapscript.mapObj(r\"C:\\Maps\\mymap.map\")\r\n >>> extent = test_map.extent\r\n\r\nCreate a layer from a string:\r\n\r\n.. code-block:: python\r\n\r\n >>> import mapscript\r\n >>> layer = mapscript.fromstring(\"\"\"LAYER NAME \"test\" TYPE POINT END\"\"\")\r\n >>> layer\r\n \r\n >>> layer.name\r\n 'test'\r\n >>> layer.type == mapscript.MS_LAYER_POINT\r\n True\r\n\r\nBuilding the Mapscript Module\r\n-----------------------------\r\n\r\nThe mapscript module is built as part of the MapServer CMake build process. This is configured using the ``mapserver/mapscript/CMakeLists.txt`` file. \r\n\r\nBefore the switch to CMake MapServer mapscript was built using distutils and ``setup.py``. Now the ``setup.py.in`` file is used as a template that\r\nis filled with the MapServer version number and used to created wheel files for distribution, or install mapscript directly on the build machine. \r\n\r\nThe build process works as follows. \r\n\r\n+ CMake runs SWIG. This uses the SWIG interface files to create a ``mapscriptPYTHON_wrap.c`` file, \r\n and a ``mapscript.py`` file containing the Python wrapper to the mapscript binary module. \r\n+ CMake then uses the appropriate compiler on the system to compile the ``mapscriptPYTHON_wrap.c`` file into a Python binary module -\r\n ``_mapscript.pyd`` file on Windows, and a ``_mapscript.so`` file on Unix. \r\n\r\n``CMakeLists.txt`` is configured with a ``pythonmapscript-wheel`` target that copies all the required files to the output build folder where they are then packaged\r\ninto a Python wheel. The wheel can be built using the following command:\r\n\r\n.. code-block:: bat\r\n\r\n cmake --build . --target pythonmapscript-wheel\r\n\r\nThe ``pythonmapscript-wheel`` target creates a virtual environment, creates the Python wheel, installs it to the virtual environment and finally runs the test\r\nsuite. This process runs commands similar to the following:\r\n\r\n.. code-block:: bat\r\n\r\n python -m pip install virtualenv\r\n virtualenv mapscriptvenv\r\n python -m pip install --upgrade pip\r\n pip install -r requirements-dev.txt\r\n python setup.py bdist_wheel\r\n pip install --no-index --find-links=dist mapscript\r\n python -m pytest --pyargs mapscript.tests\r\n\r\nSWIG can also be run manually, without using CMake. This may allow further optimizations and control on the output. \r\n\r\n.. code-block:: bat\r\n\r\n cd C:\\Projects\\mapserver\\build\r\n SET PATH=C:\\MapServerBuild\\swigwin-3.0.12;%PATH%\r\n swig -python -shadow -o mapscript_wrap.c ../mapscript.i\r\n\r\nSWIG has several command line options to control the output, examples of which are shown below:\r\n\r\n.. code-block:: bat\r\n\r\n swig -python -shadow -modern -templatereduce -fastdispatch -fvirtual -fastproxy \r\n -modernargs -castmode -dirvtable -fastinit -fastquery -noproxydel -nobuildnone \r\n -o mapscript_wrap.c ../mapscript.i\r\n\r\nTesting\r\n-------\r\n\r\nThe mapscript module includes a test suite and a small sample dataset to check the output and MapServer installation. It is recommended\r\n`pytest `_ is used to run the tests. This can be installed using:\r\n\r\n.. code-block:: bat\r\n\r\n pip install pytest\r\n\r\nMake sure the MapServer binaries are on the system path, and that the PROJ_LIB variable has been set as this is required for many of the tests. \r\n\r\n.. code-block:: bat\r\n\r\n SET PATH=C:\\release-1911-x64-gdal-2-3-mapserver-7-4\\bin;%PATH%\r\n SET PROJ_LIB=C:\\release-1911-x64-gdal-2-3-mapserver-7-4\\bin\\proj\\SHARE\r\n\r\nFinally run the command below to run the test suite: \r\n\r\n.. code-block:: bat\r\n\r\n pytest --pyargs mapscript.tests\r\n\r\nCredits\r\n-------\r\n\r\n+ Steve Lime (developer)\r\n+ Sean Gillies (developer)\r\n+ Frank Warmerdam (developer)\r\n+ Howard Butler (developer)\r\n+ Norman Vine (cygwin and distutils guru)\r\n+ Tim Cera (install)\r\n+ Michael Schultz (documentation)\r\n+ Thomas Bonfort (developer)\r\n+ Even Rouault (developer)\r\n+ Seth Girvin (Python3 migration, documentation and builds)\r\n+ Claude Paroz (Python3 migration)\r\n\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.mapserver.org", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "mapscript", "package_url": "https://pypi.org/project/mapscript/", "platform": "", "project_url": "https://pypi.org/project/mapscript/", "project_urls": { "Homepage": "http://www.mapserver.org" }, "release_url": "https://pypi.org/project/mapscript/7.4.0/", "requires_dist": null, "requires_python": "", "summary": "MapServer Python MapScript bindings", "version": "7.4.0" }, "last_serial": 5359968, "releases": { "5.02.2.33": [ { "comment_text": "", "digests": { "md5": "7401fb50c93f032a987f2a59c1f71f5e", "sha256": "245e3c5f01c7b235955d23ab8b1ad081e5e18e837f9ec469d06802a196f4a542" }, "downloads": -1, "filename": "mapscript-5.02.2.33.tar.gz", "has_sig": false, "md5_digest": "7401fb50c93f032a987f2a59c1f71f5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 147424, "upload_time": "2009-08-07T15:23:18", "url": "https://files.pythonhosted.org/packages/9b/d6/d6232ed0a920c9ba8290c3d7a427fc3d42be1bba815eb921081d143e13e8/mapscript-5.02.2.33.tar.gz" } ], "5.4.2.1": [ { "comment_text": "", "digests": { "md5": "67e176650771af6466ca6f01448bb933", "sha256": "e69511cbdf3e0800d393141e2f16ecf6f11d77f00602ce3333fa9ef432b65be5" }, "downloads": -1, "filename": "mapscript-5.4.2.1.tar.gz", "has_sig": false, "md5_digest": "67e176650771af6466ca6f01448bb933", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 153651, "upload_time": "2009-08-07T17:19:55", "url": "https://files.pythonhosted.org/packages/8f/7d/92af154e6b0d99fec444ff6ea345faad7850fab4efd6c2a0cbe67566cf9c/mapscript-5.4.2.1.tar.gz" } ], "5.6.3.0": [ { "comment_text": "", "digests": { "md5": "6764e8216204ba6c48bcafe2c5bbea6a", "sha256": "52af6d6dcb544151526311bdb9a06242e061f0e63f741ef762749f97712dd995" }, "downloads": -1, "filename": "mapscript-5.6.3.0.zip", "has_sig": false, "md5_digest": "6764e8216204ba6c48bcafe2c5bbea6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 204130, "upload_time": "2010-03-30T17:31:08", "url": "https://files.pythonhosted.org/packages/2a/4a/89ac6d24d2a93ee4f4bb1d3d9bdc0af8e86ba000a12a69fd3ed1e1907948/mapscript-5.6.3.0.zip" } ], "7.2": [ { "comment_text": "", "digests": { "md5": "0d9e25b662ac738ac45810c1eb6f7779", "sha256": "5dd45d2f4f1aae9a8fb7d770cb37ab0269dbbb0c8440f50f4f26a870d64f04a9" }, "downloads": -1, "filename": "mapscript-7.2-cp27-cp27m-win_amd64.whl", "has_sig": false, "md5_digest": "0d9e25b662ac738ac45810c1eb6f7779", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 266776, "upload_time": "2018-08-17T17:57:28", "url": "https://files.pythonhosted.org/packages/29/a4/1b2052c2c8d8246b2c5e54177e4bd48887eacec78af1b5cfde8bd9f732ba/mapscript-7.2-cp27-cp27m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "916b29a5f9a175b2b60851beabdd2118", "sha256": "4cd80d479b54ffe64b7962771e85db0f502351c83c7ea7a5494a84900590fe07" }, "downloads": -1, "filename": "mapscript-7.2-cp36-cp36m-win_amd64.whl", "has_sig": false, "md5_digest": "916b29a5f9a175b2b60851beabdd2118", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 266057, "upload_time": "2018-08-17T17:58:07", "url": "https://files.pythonhosted.org/packages/e4/e3/a2726e8b6b8c8c22e1ca015380fa0c04c60450f714e208b42982bda63c70/mapscript-7.2-cp36-cp36m-win_amd64.whl" } ], "7.2.1": [ { "comment_text": "", "digests": { "md5": "bc3a046742fec1496b421bd64da7f065", "sha256": "c38fdbb797f5bccb70f6d0ac99f60bdceb4d9cf684a492b4569701c1fb5ebc75" }, "downloads": -1, "filename": "mapscript-7.2.1-cp27-cp27m-win_amd64.whl", "has_sig": false, "md5_digest": "bc3a046742fec1496b421bd64da7f065", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 416210, "upload_time": "2018-10-11T22:45:08", "url": "https://files.pythonhosted.org/packages/26/7b/03e631eb124813fabfd884f2d7bd76db04c3c8252192dbc837bcfe58bf30/mapscript-7.2.1-cp27-cp27m-win_amd64.whl" } ], "7.2.1.post1": [ { "comment_text": "", "digests": { "md5": "ce701ce9ce00a804f04edadbfe5a025c", "sha256": "9ca8a7d96337f070efd8da8587c1e00fbc536fbbb62703674965b96cffa498b3" }, "downloads": -1, "filename": "mapscript-7.2.1.post1-cp27-cp27m-win_amd64.whl", "has_sig": false, "md5_digest": "ce701ce9ce00a804f04edadbfe5a025c", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 417021, "upload_time": "2018-10-11T23:01:43", "url": "https://files.pythonhosted.org/packages/05/bc/f36accc29beb753afa5f0c166be9dccdfe3569e35bd0f403a1e62f2a4864/mapscript-7.2.1.post1-cp27-cp27m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "48c8aabe73974fe0cc6ea884551c2544", "sha256": "693afd627cffc3250ef257fa8b6a0928ee144ccfa127f829f7044167f7a85c13" }, "downloads": -1, "filename": "mapscript-7.2.1.post1-cp36-cp36m-win_amd64.whl", "has_sig": false, "md5_digest": "48c8aabe73974fe0cc6ea884551c2544", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 417722, "upload_time": "2018-10-11T23:01:58", "url": "https://files.pythonhosted.org/packages/9e/03/5b859f95622266665e1f7215aabc3c268e19042d2fdfa3acd0b2cc2974c6/mapscript-7.2.1.post1-cp36-cp36m-win_amd64.whl" } ], "7.2.2": [ { "comment_text": "", "digests": { "md5": "aa8adb471c5d95cc3e7d31d96d27c9bc", "sha256": "5d9ecc6dd021af64efa0d33d5ee5aee8f7fdf0a8815cf4aa1e4a576123576569" }, "downloads": -1, "filename": "mapscript-7.2.2-cp27-cp27m-win_amd64.whl", "has_sig": false, "md5_digest": "aa8adb471c5d95cc3e7d31d96d27c9bc", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 415490, "upload_time": "2019-03-01T05:50:30", "url": "https://files.pythonhosted.org/packages/54/53/8d90fd78006da7b4cf35d6296c4b0accdc80e1fcbbc541ea93437c3ede8a/mapscript-7.2.2-cp27-cp27m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "892cea45a31da1f11dd1881df37e3d0b", "sha256": "1cca3f2d3bb3e99cc5491699bc913374fd08edaa4fc7ca584937e1a74609dc02" }, "downloads": -1, "filename": "mapscript-7.2.2-cp37-cp37m-win_amd64.whl", "has_sig": false, "md5_digest": "892cea45a31da1f11dd1881df37e3d0b", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 416343, "upload_time": "2019-03-01T05:51:06", "url": "https://files.pythonhosted.org/packages/b2/9f/64ab21687d6fb9c6c6a0f1162312a6418a8d9599c2dd4b6f5973c856f2b9/mapscript-7.2.2-cp37-cp37m-win_amd64.whl" } ], "7.4.0": [ { "comment_text": "", "digests": { "md5": "adf31f5a32ef2d18a2e5ddc3e46f281c", "sha256": "3fb3bf6088f60e5b21aa953ab3f4c6e56e7cff345615a001ab0650ca21351317" }, "downloads": -1, "filename": "mapscript-7.4.0-cp27-cp27m-win_amd64.whl", "has_sig": false, "md5_digest": "adf31f5a32ef2d18a2e5ddc3e46f281c", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 420059, "upload_time": "2019-06-04T23:02:13", "url": "https://files.pythonhosted.org/packages/1f/26/7f6a680833620429369d726ba866f4a5f3b981f1d41a15db697f1ffcaa89/mapscript-7.4.0-cp27-cp27m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "4d83daf4015a1cb1389db4df64535eb5", "sha256": "8bf50ca5a205f34a15101bf680359661a596f00bbde7d1fb57a07af75a632509" }, "downloads": -1, "filename": "mapscript-7.4.0-cp37-cp37m-win_amd64.whl", "has_sig": false, "md5_digest": "4d83daf4015a1cb1389db4df64535eb5", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 420841, "upload_time": "2019-06-04T23:02:35", "url": "https://files.pythonhosted.org/packages/23/1f/48299e6561e24ff4efbaf115219075067fcf28b57e03414b7b0897d33543/mapscript-7.4.0-cp37-cp37m-win_amd64.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "adf31f5a32ef2d18a2e5ddc3e46f281c", "sha256": "3fb3bf6088f60e5b21aa953ab3f4c6e56e7cff345615a001ab0650ca21351317" }, "downloads": -1, "filename": "mapscript-7.4.0-cp27-cp27m-win_amd64.whl", "has_sig": false, "md5_digest": "adf31f5a32ef2d18a2e5ddc3e46f281c", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 420059, "upload_time": "2019-06-04T23:02:13", "url": "https://files.pythonhosted.org/packages/1f/26/7f6a680833620429369d726ba866f4a5f3b981f1d41a15db697f1ffcaa89/mapscript-7.4.0-cp27-cp27m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "4d83daf4015a1cb1389db4df64535eb5", "sha256": "8bf50ca5a205f34a15101bf680359661a596f00bbde7d1fb57a07af75a632509" }, "downloads": -1, "filename": "mapscript-7.4.0-cp37-cp37m-win_amd64.whl", "has_sig": false, "md5_digest": "4d83daf4015a1cb1389db4df64535eb5", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 420841, "upload_time": "2019-06-04T23:02:35", "url": "https://files.pythonhosted.org/packages/23/1f/48299e6561e24ff4efbaf115219075067fcf28b57e03414b7b0897d33543/mapscript-7.4.0-cp37-cp37m-win_amd64.whl" } ] }