Download the PHP package prinsfrank/php-geo-svg without Composer

On this page you can find all versions of the php package prinsfrank/php-geo-svg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-geo-svg

PHP Geo SVG

GitHub Build Status Scrutinizer Code Quality Code Coverage PHP Version Support

Generate and display maps without external services or compromising on privacy.

Why this package?

When searching for high quality SVG's for my blog, I ran into the issue that all SVG's where either too low quality, heavily polluted with unnecessary elements by the tool they were generated with, or in the wrong projection. This package provides the flexibility to generate maps manually or from geojson files, which are more readily available.

Features

Showcase
Countries - Equirectangular projection
Netherlands - Mercator projection

Table of Contents

Setup

Make sure you are running PHP 8.0 or higher to use this package

To start right away, run the following command in your composer project;

Or for development only;

The basics; creating an SVG

Let's say we want to create the following simple continent map:

There are multiple ways we can go about creating this map in svg using this package;

From a GeoJSON file

To create an SVG from a GeoJson file, create a new 'GeometryCollection' by calling the 'createFromGeoJSONFilePath' method on the 'GeometryCollectionFactory' as follows;

Show code With variables: Fluent:

From a GeoJSON string

To create an SVG from a GeoJson string, create a new 'GeometryCollection' by calling the 'createFromGeoJsonString' method on the 'GeometryCollectionFactory' as follows;

Show code With variables: Fluent:

From a GeoJSON array

To create an SVG from a GeoJson array, create a new 'GeometryCollection' by calling the 'createFromGeoJSONArray' method on the 'GeometryCollectionFactory' as follows;

Show code With variables: Fluent:

From building your own GeometryCollection

To build an SVG manually from a GeometryCollection, create the object and add any geometry you want:

Show code With variables: Fluent:

Different globe-to-plane transformations; Projections

If you prefer a different projection other than the default EquiRectangular, you can! Currently, the following projections are supported, but please feel free to add any and open a PR;

To specify the projection you want to use, you can do so either using the constructor;

Or using the 'setProjection' method;

Displaying only parts of the world; Using bounding boxes

If you want to use a bounding box, you have to know both the most southWestern and northEastern coordinates you want to show, and create 'BoundingBoxPositions' for both of them. Pass those along to a bounding box object and you have yourself a bounding box;

To actually use it, either pass the bounding box in the constructor after the projection;

Or set the bounding box using the 'setBoundingBox' method;


All versions of php-geo-svg with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package prinsfrank/php-geo-svg contains the following files

Loading the files please wait ....