2017 © Pedro PelĂĄez
 

library doctrine-geojson

GeoJson Doctrine Models

image

rogeriolino/doctrine-geojson

GeoJson Doctrine Models

  • Friday, May 16, 2014
  • by rogeriolino
  • Repository
  • 1 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

doctrine-geojson

GeoJson Doctrine Models, (*1)

Requirements

  • PHP 5.4+
  • Doctrine 2.4+

Usage

Saving

  <?php

  $feature = new Feature();
  $feature->add(new Property('name', 'Rogerio Lino'));
  $feature->setGeometry(
    (new Geometry('Point'))
      ->add(new Coordinate(-40, -20, 0))
  );

  $entityManager->persist($feature);
  $entityManager->flush();

Retrieving

  <?php

  $features = $entityManager
                    ->getRepository('RogerioLino\Doctrine\GeoJson\Feature')
                    ->findAll();
  echo json_encode(new FeatureCollection($features));

JSON Output, (*2)

  {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -40,
                    -20,
                    0
                ]
            },
            "properties": {
                "name": "Rogerio Lino"
            }
        }
    ]
  }

The Versions

16/05 2014

dev-master

9999999-dev http://www.rogeriolino.com

GeoJson Doctrine Models

  Sources   Download

MIT

The Requires

 

json doctrine geojson gis