I think this is separate topic for discussion and decided take it out
from the other thread.
I am looking at GeoPHP and your SQLite to GeoJSON and PostGIS to
GeoJSON code, I could not decipher how to use these in order to
GeoJSON from Select statement i.e. a table.
Supposing I have contact table in PostGIS, How do I incorporate this
select statement?
Select name, street, phoneno, ST_asGeoJSON(the_geom) from contact
where street = 'Church St';
where: the_geom is point
I like to see an example code for PostGIS to GeoJSON and SQLite to
GeoJSON as well.
Do you have any Leaflet projects online or example that use these 2
PHP scripts (i.e. SQLite to GeoJSON and PostGIS to GeoJSON)?
Thanks in advance.
Noli
Thanks. I'm getting it now.
So, only reason why SQLite GeoJSON needs geoPHP is it does not have spatial.
It would be good to use Spatialite since it has now GeoJSON.
Spatialite 3.x has support for AsGeoJSON(geometry), not to mention WKB
already supported in previous Spatialite 2.x versions.
Here's Spatialite PHP
http://www.gaia-gis.it/spatialite-2.4.0-4/splite-php.html
Thanks again.
Noli
On 4/4/12, Bryan McBride <mcbrid...@gmail.com> wrote:
> Noli,
>
> These are PHP scripts that basically echo GeoJSON output from an SQL select
> statement build from URL parameters. They need to be run from a server with
> PHP installed and configured correctly. The
> PostGIS<https://gist.github.com/1913855>script requires PHP with php_pgsql
> enabled, while the
> SQLite <https://gist.github.com/1920796> script requires PHP with
> PDO_SQLITE enabled and a geoPHP <https://github.com/phayes/geoPHP> include
You might interested to try spatialite and needs data.
U.S. 2011 Census TIGER/Line files in Spatialite format.
From Spatialite GG.
"All the state, county, and municipality boundary shapefiles
for a project. Two versions are up - one pretty much as the Census Bureau
releases them, with one state per table/shapefile. The other is the
version we're actually using, with the state tables combined" - B Freed
stineconsulting.com.
Alex Mandel 7.z it here.
180MB for Combined and 169 for Boundaries
http://downloads.ice.ucdavis.edu/osgeo/data/
Thanks.
Noli