PHP library to easily get static image from French Cadastral Government map with markers and lines.

Overview

PHP French Cadastral Map Static API

PHP library to easily get static image from French Cadastral Government map with markers and lines.

Map source : cadastre.gouv.fr

API PHP de Carte Statique du Cadastre Français

Librairie PHP permettant d'extraire facilement des images de la carte du cadastre Français avec des markers et des tracés.

Source de la carte : cadastre.gouv.fr

Supporting

Star this repository to support this project. You will contribute to increase the visibility of this library 🙂

Installation

Install this library easily with composer :

composer require dantsu/french-cadastral-map-static-api

How to use

Generate French Cadastral map static image with marker and line :

use \DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralMap;
use \DantSu\FrenchCadastralMapStaticAPI\LatLng;
use \DantSu\FrenchCadastralMapStaticAPI\Line;
use \DantSu\FrenchCadastralMapStaticAPI\Markers;

\header('Content-type: image/png');
(new FrenchCadastralMap(12202, new LatLng(44.351933, 2.568113), 17, 600, 400))
    ->setLayers([
        FrenchCadastralMap::LAYER_AMORCES_CAD,
        FrenchCadastralMap::LAYER_CADASTRAL_PARCEL,
        FrenchCadastralMap::LAYER_SUBFISCAL,
        // FrenchCadastralMap::LAYER_CLOTURE,
        FrenchCadastralMap::LAYER_DETAIL_TOPO,
        FrenchCadastralMap::LAYER_HYDRO,
        FrenchCadastralMap::LAYER_BUILDING,
        FrenchCadastralMap::LAYER_BORNE_REPERE,
        // FrenchCadastralMap::LAYER_VOIE_COMMUNICATION,
        // FrenchCadastralMap::LAYER_LIEUDIT
    ])
    ->setDisplayOpenStreetMap(true)
    ->addMarkers(
        (new Markers(__DIR__ . '/resources/marker.png'))
            ->setAnchor(Markers::ANCHOR_CENTER, Markers::ANCHOR_BOTTOM)
            ->addMarker(new LatLng(44.351933, 2.568113))
            ->addMarker(new LatLng(44.351510, 2.570020))
            ->addMarker(new LatLng(44.351873, 2.566250))
    )
    ->addLine(
        (new Line('FF0000', 2))
            ->addPoint(new LatLng(44.351172, 2.571092))
            ->addPoint(new LatLng(44.352097, 2.570045))
            ->addPoint(new LatLng(44.352665, 2.568107))
            ->addPoint(new LatLng(44.352887, 2.566503))
            ->addPoint(new LatLng(44.352806, 2.565972))
            ->addPoint(new LatLng(44.351517, 2.565672))
            ->addPoint(new LatLng(44.351172, 2.571092))
    )
    ->getImage()
    ->displayPNG();

Exported French Cadastral image

Documentation

Class Description
FrenchCadastralMap DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralMap is a PHP library created for easily get static image from French Cadastral Government map with markers and lines.
LatLng DantSu\FrenchCadastralMapStaticAPI\LatLng define latitude and longitude for map, lines, markers.
Line DantSu\FrenchCadastralMapStaticAPI\Line draw line on the map.
Markers DantSu\FrenchCadastralMapStaticAPI\Markers display markers on the map.
XY DantSu\FrenchCadastralMapStaticAPI\XY define X and Y pixel position for map, lines, markers.

Contributing

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed.

You might also like...
PHP library for determining the physical location of binaries

Bin Locator Library for searching binary files in the operating system. Requirements PHP = 7.4 Installation Library is available as composer reposito

GeoSpatial integration on Laravel 5.2+ that supports MySQL and PostgreSQL.

Features GeoSpatial integration on Laravel 5.2+: Create geospatial columns using Schema and migrations Save and retrieve geospatial attributes using d

Free database of geographic place names and corresponding geospatial data

FreeGeoDB Free database of geographic place names and corresponding geospatial data Entities airports cities countries (admin-0) lakes ports railroads

Use: [i] to share item and name in hand, [coor] to share you current coordinates

General Now you can share your Coordinates and Item with Prefix Example if you type [i] in message, later it will be automatically replaced into the n

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

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

PHP extension for geospatial rendering with Mapnik
PHP extension for geospatial rendering with Mapnik

PHP7 Mapnik Introduction This project is an extension for PHP 7 that enables geospatial rendering with Mapnik. Create tile generation scripts, dynamic

PHP Extension to handle common geospatial functions.

geospatial - PHP Geospatial Extension PHP Extension to handle common geospatial functions. The extension currently has implementations of the Haversin

GeoJSON implementation for PHP

GeoJson PHP Library This library implements the GeoJSON format specification. The GeoJson namespace includes classes for each data structure defined i

Releases(1.0.0)
  • 1.0.0(Nov 2, 2022)

    PHP library to easily get static image from French Cadastral Government map with markers, lines, polygons and circles.

    • Update dantsu/php-osm-static-api to v0.4
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(May 24, 2022)

    PHP library to easily get static image from French Cadastral Government map with markers, lines, polygons and circles.

    • add polygons and circles options
    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(May 10, 2022)

  • 0.1.2(Apr 11, 2022)

  • 0.1.1(Apr 6, 2022)

  • 0.1.0(Sep 9, 2021)

  • 0.0.1(Sep 8, 2021)

  • 0.0.0(Sep 8, 2021)

Owner
Franck Alary
Web and mobile app developer.
Franck Alary
New WordPress plugin to render a map with multiple markers using the open source maps provider OpenStreetMap

markers-on-openstreetmap New WordPress plugin to render a map with multiple markers using the open source maps provider OpenStreetMap A friend of mine

Oscar Alderete 2 Oct 25, 2021
A collection of all 774 local government areas in Nigeria

A collection of all 774 local government areas in Nigeria. All LGAS with State Name, Latitude, Longitude and Wikidata:Identifiers.

null 3 Sep 30, 2022
DRK LoRaWAN Map App

DRK LoRaWAN Map App This is an LoRaWAN Map App which implements an public facing interface for the LoRaWAN GPS Tracker using leaflet and OpenStreetMap

Tobias Zulauf 2 Oct 31, 2022
A Laravel package to get the user's country using the ip.

Laravel IP Service Tries to guess the country code of the client, using his IP. Installation Download and import the ip database from ip2nation.com Us

Dimitris Savvopoulos 119 Nov 29, 2022
Geo-related tools PHP 5.4+ library built atop Geocoder and React libraries

Geotools Geotools is a PHP geo-related library, built atop Geocoder and React libraries. Features Batch geocode & reverse geocoding request(s) in seri

The League of Extraordinary Packages 1.3k Dec 27, 2022
Official PHP library for IPinfo (IP geolocation and other types of IP data)

This is the official PHP client library for the IPinfo.io IP address API, allowing you to lookup your own IP address,

IPinfo 171 Jan 2, 2023
ESRI ShapeFile library for PHP

shapefile ShapeFile library for PHP Features Currently the 2D and 3D variants except MultiPatch of the ShapeFile format as defined in https://www.esri

phpMyAdmin 23 Jun 29, 2022
The most featured Geocoder library written in PHP.

Geocoder Important: You are browsing the documentation of Geocoder 4.x. Documentation for version 3.x is available here: Geocoder 3.x documentation. D

Geocoder 3.9k Jan 2, 2023
Simple Yet Powerful Geo Library for PHP

phpgeo - A Simple Geo Library for PHP phpgeo provides abstractions to geographical coordinates (including support for different ellipsoids) and allows

Marcus Jaschen 1.4k Dec 27, 2022
PHP library to access the OpenCage geocoding API

OpenCage Geocoding API Library for PHP A PHP library to use the OpenCage geocoding API. Build Status / Code Quality Overview This library attempts to

OpenCage GmbH 29 Nov 15, 2022