MapServer and PHP-MapScript application to create publication-quality maps

Related tags

Laravel SimpleMappr
Overview

SimpleMappr Installation and Configuration

SimpleMappr, http://www.simplemappr.net is a web-based application that produces publication-quality geographic maps. This source code is released under MIT license.

Developer: David P. Shorthouse
Email: [email protected]

Build Status Coverage Status DOI Join the chat at https://gitter.im/dshorthouse/SimpleMappr

Server Requirements

See how the travis.yml file is configured for Travis-CI's continuous integration of automated unit and functional testing.

  1. PHP5.6+ [with cli, PDO, PDO-MySQL, GD]
  2. Apache2.2.24+ [with rewrite]
  3. MySQL 5.5.27+
  4. MapServer 7.2.0 [with PROJ, GDAL, GEOS, Cairo]
  5. Composer

Configuration Instructions

  1. Download shapefiles from Natural Earth Data, http://www.naturalearthdata.com/ and extract into mapserver/maps/. Adjust Apache read permissions as necessary.
  2. Rename and adjust:
  1. Adjust config/conf.test.php used during execution of tests
  2. If you wish to use Janrain's OpenID authentication system, sign-up at http://rpxnow.com and replace the RPX_KEY in config/conf.php
  3. The jQuery-based front-end assumes clean URLs and operates in a RESTful fashion. Configure mod_rewrite as follows:

Apache Rewrite Configuration

<VirtualHost *:80>
  ServerName mydomain.net
  ServerAlias mydomain.net
  DocumentRoot /path/to/your/root
  <Directory "/path/to/your/root">
   Options -Indexes +FollowSymlinks
   AllowOverride None
   Order allow,deny
   Allow from all
   DirectoryIndex index.php
   RewriteEngine on
   RewriteBase /
   RewriteRule ^(public|sitemap.xml|robots.txt)($|/) - [L]
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  </Directory>
</VirtualHost>

Homebrew on Mac OSX

  1. Install PHP5.6. See https://github.com/homebrew/homebrew-php

  2. Execute from command line:

     $ brew install \
       autoconf \
       freetype \
       jpeg \
       libpng \
       gd --with-freetype --with-png --with-jpeg --with-tiff \
       gdal \
       geos \
       gettext \
       icu4c \
       proj \
       cairo \
       libsvg-cairo \
       fribidi \
       phpunit \
       composer
    
  3. Download MapServer 7.2.0 tarball, http://download.osgeo.org/mapserver/mapserver-7.2.0.tar.gz

  4. Extract and cd into folder

  5. Execute from command line:

       $ mkdir build; cd build; cmake .. \
         -DCMAKE_PREFIX_PATH="/usr/local/opt/libiconv;/usr/local/opt/php56;/usr/local/opt/phpunit;/usr/local/opt/geos;/usr/local/opt/pkg-config;/usr/local/opt/libxml2;/usr/local/opt/zlib;/usr/local/opt/fontconfig;/usr/local/opt/cairo;/usr/local/opt/fribidi;/usr/local/opt/proj;/usr/local/opt/giflib;/usr/local/opt/freetype;/usr/local/opt/libsvg;/usr/local/opt/libsvg-cairo;/usr/local/opt/gdal2;/usr/local/opt/libpng;/usr/local/opt/libjpeg;/usr/local/opt/harfbuzz;/usr/local/opt/exempi" \
         -DWITH_KML=1 \
         -DWITH_PHP=1 \
         -DWITH_EXEMPI=1 \
         -DWITH_SVGCAIRO=1 \
         -DWITH_FCGI=0 \
         -DWITH_RSVG=0 \
         -DWITH_POSTGIS=0 \
         -DFRIBIDI_INCLUDE_DIR="/usr/local/include/glib-2.0;/usr/local/lib/glib-2.0/include;/usr/local/include" \
         -DPHP5_INCLUDE_PATH="/usr/local/include/php"
    
       $ make && make install
    
  6. Verify that mapserv is working

       $ mapserv -v
    
  7. Add extension=php_mapscript.so to php.ini (if not already there) and restart web server

Unix-based Server

See the useful guide on MapServer.

Internationalization

The following two commands make a messages.po file (by reading the index.php file) then a binary messages.mo file from a messages.po file as input. Both need to be moved to relevant i18n directory such as i18n/fr_FR.UTF-8/LC_MESSAGES. You'll need to translate the strings in messages.po before making the binary of course. Whenever any string is changed in any messages.po file, the messages.mo file must be generated and Apache must be restarted because translated strings are enumerated into memory when the application first loads.

$ xgettext -n index.php
$ msgfmt messages.po

Alternatively, you can use the ruby utility, crawler.rb from the /i18n directory to make a messages.po file and move it to i18n/fr_FR.UTF-8/LC_MESSAGES.

$ cd i18n
$ ruby crawler.rb ../views

Dependencies

Install all necessary application dependencies using composer and update them as required.

$ composer install
$ composer update

Database

SimpleMappr uses MySQL and phinx for migrations. A sample schema is included in /db and migrations are stored in /db/migrations. Create MySQL databases simplemappr, simplemappr_development and simplemappr_testing. Use /db/sample.db.sql to create tables.

$ ./vendor/bin/phinx migrate -c config/phinx.yml -e development

Tests

PHPUnit is used for unit tests and Selenium and Facebook's php-webdriver are used for integration tests. Composer is used to include dependencies. The Firefox Gecko driver can be downloaded here.

$ java -Dwebdriver.gecko.driver=/usr/local/bin/geckodriver -jar /usr/local/bin/selenium-server-standalone-3.9.1.jar
$ BROWSER=firefox ./vendor/bin/phpunit -c Tests/phpunit.xml --stderr

If you wish to use Chrome instead of FireFox, the Selenium Chromedriver can be found at http://chromedriver.storage.googleapis.com/index.html:

$ java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium-server-standalone-3.9.1.jar
$ BROWSER=chrome ./vendor/bin/phpunit -c Tests/phpunit.xml --stderr

Tests are split into suites entitled, "Unit", "Functional", "Binary", "Router"

$ ./vendor/bin/phpunit -c Tests/phpunit.xml --testsuite "Unit" --stderr

JavaScript Minification

JavaScript files are minified using Google's Closure Compiler as follows:

$ java -jar compiler.jar --js simplemappr.js --js_output_file simplemappr.min.js

Copyright

Copyright (c) 2010-2018 David P. Shorthouse

Released under MIT License

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.
Comments
  • Call to a member function saveWebImage() on null

    Call to a member function saveWebImage() on null


    Warning: mapObj::drawQuery(): [MapServer Error]: msDrawMap(): Failed to draw layer named 'countries'. in /private/var/www/src/Mappr.php on line 1795

    Warning: mapObj::drawQuery(): [MapServer Error]: msShapefileOpen(): (/private/var/www/mapserver/maps/10m_cultural/10m_cultural/ne_10m_admin_0_map_units) in /private/var/www/src/Mappr.php on line 1795

    Warning: mapObj::drawQuery(): [MapServer Error]: msDrawMap(): Failed to draw layer named 'relief'. in /private/var/www/src/Mappr.php on line 1795

    Warning: mapObj::drawQuery(): [MapServer Error]: msDrawRasterLayerLow(): Corrupt, empty or missing file '/private/var/www/mapserver/maps/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif' for layer 'relief'. in /private/var/www/src/Mappr.php on line 1795

    Fatal error: Call to a member function saveWebImage() on null in /private/var/www/src/MapprApplication.php on line 91
    opened by zek 2
  • Bump twig/twig from 1.37.1 to 1.38.0

    Bump twig/twig from 1.37.1 to 1.38.0

    Bumps twig/twig from 1.37.1 to 1.38.0.

    Changelog

    Sourced from twig/twig's changelog.

    • 1.38.0 (2019-03-12)

    • fixed sandbox security issue (under some circumstances, calling the __toString() method on an object was possible even if not allowed by the security policy)

    • fixed batch filter clobbers array keys when fill parameter is used

    • added preserveKeys support for the batch filter

    • fixed "embed" support when used from "template_from_string"

    • added the possibility to pass a TemplateWrapper to Twig\Environment::load()

    • improved the performance of the sandbox

    • added a spaceless filter

    • added max value to the "random" function

    • made namespace classes the default classes (PSR-0 ones are aliases now)

    • removed duplicated directory separator in FilesystemLoader

    • added Twig\Loader\ChainLoader::getLoaders()

    • changed internal code to use the namespaced classes as much as possible

    Commits
    • 754b8df prepared the 1.38.0 release
    • 0f3af98 security #2885 Fix security issue in the sandbox (fabpot)
    • 5e1a361 removed one usage of Template vs TemplateWrapper
    • eac5422 fixed security issue in the sandbox
    • 7e30569 bug #2884 Fix "batch filter clobbers array keys when fill parameter is used "...
    • 750cb23 fixed batch filter clobbers array keys when fill parameter is used
    • ede9a60 added preserveKeys support for the batch filter
    • 4eeaf76 bug #2883 Fix "embed" support when used from "template_from_string" (fabpot)
    • 9f23f7c removed dead code
    • 92a63e0 fixed "embed" support when used from "template_from_string"
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Add a Gitter chat badge to README.md

    Add a Gitter chat badge to README.md

    dshorthouse/SimpleMappr now has a Chat Room on Gitter

    @dshorthouse has just created a chat room. You can visit it here: https://gitter.im/dshorthouse/SimpleMappr.

    This pull-request adds this badge to your README.md:

    Gitter

    If my aim is a little off, please let me know.

    Happy chatting.

    PS: Click here if you would prefer not to receive automatic pull-requests from Gitter in future.

    opened by gitter-badger 0
  • Replace various flavours of dashes and the negative symbol

    Replace various flavours of dashes and the negative symbol

    In the makeCoordinates static function at https://github.com/dshorthouse/SimpleMappr/blob/master/src/Utility.php#L237, various dashes and the negative symbol would slip through here and be silently removed through preg_replace. Instead, these should be converted to a single dash as that's what is expected by MapServer.

    bug 
    opened by dshorthouse 0
  • Bump twig/twig from 1.38.0 to 1.44.7

    Bump twig/twig from 1.38.0 to 1.44.7

    Bumps twig/twig from 1.38.0 to 1.44.7.

    Changelog

    Sourced from twig/twig's changelog.

    1.44.7 (2022-09-28)

    • Fix a security issue on filesystem loader (possibility to load a template outside a configured directory)

    1.44.6 (2021-11-25)

    • Last version for the 1.x series

    1.44.5 (2021-09-17)

    • Improve compatibility with PHP 8.1
    • Explicitly specify the encoding for mb_ord in JS escaper

    1.44.4 (2021-05-16)

    • Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)"

    1.44.3 (2021-05-12)

    • Fix PHP 8.1 compatibility
    • Throw a proper exception when a template name is an absolute path (as it has never been supported)

    1.44.2 (2021-01-05)

    • Fix "odd" not working for negative numbers

    1.44.1 (2020-10-27)

    • Fix "include(template_from_string())"

    1.44.0 (2020-10-21)

    • Remove implicit dependency on ext/iconv in JS escaper
    • Fix sandbox support when using "include(template_from_string())"
    • Make round brackets optional for one argument tests like "same as" or "divisible by"
    • Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a }
    • Fix filter(), map(), and reduce() to throw a RuntimeError instead of a PHP TypeError
    • Drop PHP 7.1 support

    1.43.1 (2020-08-05)

    • Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag
    • Fix a regression when not using a space before an operator
    • Restrict callables to closures in filters
    • Allow trailing commas in argument lists (in calls as well as definitions)

    1.43.0 (2020-07-05)

    • Throw exception in case non-Traversable data is passed to "filter"
    • Fix context optimization on PHP 7.4

    ... (truncated)

    Commits
    • 0887422 Prepare the 1.44.7 release
    • 35f3035 security #cve- Fix a security issue on filesystem loader (possibility to load...
    • f800934 Fix a security issue on filesystem loader (possibility to load a template out...
    • ae39480 Prepare the last release for the 1.x series
    • 7e5ba95 minor #3584 Fix emphasis on compiler to bold styling (jonnyeom)
    • 97ae3c8 Fix emphasis on compiler to bold styling
    • 8bab813 minor #3570 Update .gitattributes to exclude non-dist files (kaznovac)
    • 92766d0 Update .gitattributes to exclude non-dist files
    • 3a18bb3 Fix CS
    • 212e49b minor #3563 Missing Environment and LoaderInterface (remicollet)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v3.1)
Laravel Google Maps Package

Laravel Google Maps This repo aims to use google map features in laravel 5.x. It is easy to use and flexible, you can just install this package and en

Farhan Wazir 146 Nov 29, 2022
An easy way to integrate Google Maps with Laravel

An easy way to integrate Google Maps with Laravel For Laravel 5.x, check version 2.35.1 For Laravel 4.x, check version 1.27.0 Think of Googlmapper as

Bradley Cornford 450 Nov 29, 2022
Collection of Google Maps API Web Services for Laravel

Collection of Google Maps API Web Services for Laravel Provides convenient way of setting up and making requests to Maps API from Laravel application.

Alexander Pechkarev 467 Jan 5, 2023
A simple job posting application using PHP with an Admin Panel. Register, Login and create the job in apnel. The job gets posted on index page.

Jobee A simple job posting application using PHP with an Admin Panel. Register, Login and create the job in apnel. The job gets posted on index page.

Fahad Makhdoomi 2 Aug 27, 2022
Blacksmith is a code generation tool which automates the creation of common files that you'd typically create for each entity in your application.

Blacksmith is a code generation tool which automates the creation of common files that you'd typically create for each entity in your application.

Indatus 197 Dec 30, 2022
A Laravel chat package. You can use this package to create a chat/messaging Laravel application.

Chat Create a Chat application for your multiple Models Table of Contents Click to expand Introduction Installation Usage Adding the ability to partic

Tinashe Musonza 931 Dec 24, 2022
Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create

Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create. The directives you want Forman to perform are outlined in a JSON based template file.

Indatus 145 Apr 13, 2022
Create and manage A Domain Driven Design (DDD) in your Laravel app, simply and efficiently.

Create and manage A Domain Driven Design (DDD) in your Laravel app, simply and efficiently.

Lucas Nepomuceno 4 Jun 11, 2022
Create a downloads list - quick and easy. With categories and mobile friendly design

Simple downloads list plugin for wordpress Create a downloads list - quick and easy. With categories and mobile friendly design What is Simple downloa

Neofix 2 Dec 4, 2022
States allows you to create PHP classes following the State Pattern in PHP.

States allows you to create PHP classes following the State Pattern in PHP. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements and this improve maintainability and workflows writing.

Teknoo Software 10 Nov 20, 2022
Migrator is a GUI migration manager for Laravel which you can create, manage and delete your migration.

Migrator Migrator is a GUI migration manager for Laravel which you can create, manage and delete your migration. Installation: To install Migrator you

Reza Amini 457 Jan 8, 2023
This package enables you to create and run a fully functioning WebSocket server in your Laravel app.

This package enables you to create and run a fully functioning WebSocket server in your Laravel app. It can optionally receive messages broadcast over ZeroMQ.

Asked.io 181 Oct 6, 2022
Simple Arabic Laravel Dashboard , has basic settings and a nice layout . to make it easy for you to create fast dashboard

Simple Arabic Laravel Dashboard ✅ Auto Seo ✅ Optimized Notifications With Images ✅ Smart Alerts ✅ Auto Js Validations ✅ Front End Alert ✅ Nice Image V

Peter Tharwat 254 Dec 19, 2022
An open source Laravel Soundboard with Admin Panel CRUD (Create Read Update Delete) built on Laravel, Bootstrap, and Vue.js

Laravel Soundboard An open source Laravel Soundboard with Admin Panel CRUD (Create Read Update Delete) built on Laravel 5.8, Bootstrap 4, Vue.js, Boot

Jeremy Kenedy 24 Oct 28, 2022
A PocketMine plugin to create custom ranks and permissions manager!

Ranks A PocketMine plugin to create custom ranks and permissions manager! ##Commands Command Usage Example /rank add - adds ranks! /rank add <rank_nam

DevilDev 4 Apr 6, 2022
Programmatically create and render barcodes as images or in PDFs

laminas-barcode ???? Русским гражданам Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги к

Laminas Project 22 Nov 23, 2022
A university system that creates a timetable programm for subjects,classes and teachers which is used to create a programm for each semester. All this served as a website.

Timetable-System-Generator A university system that creates a timetable programm for subjects,classes and teachers which is used to create a programm

null 3 Nov 19, 2022
Create Laravel views (blade template) using 'php artisan' command-line interface

About LaraBit Have you ever wonder to create Laravel views (Blade Templates) using the same type of artisan commands that you usually use to create ne

Ragib MRB 5 Oct 15, 2021
A platform to create documentation/wiki content built with PHP & Laravel

BookStack A platform for storing and organising information and documentation. Details for BookStack can be found on the official website at https://w

BookStackApp 10.7k Jan 5, 2023