Showing posts with label GEO fencing. Show all posts
Showing posts with label GEO fencing. Show all posts

Install QGIS to visualize GeoJSON

Give it a try in Terminal
$ brew install qgis
Error: No available formula for qgis 

No problem, you will find most of the needed frameworks here:


In addition to Mac .dmg files available above I am providing few Terminal commands you might need:


$  brew install gfortran
...
/usr/local/Cellar/gfortran/4.8.2: 960 files, 113M
 $ 

$ brew install pkg-config
Warning: pkg-config-0.28 already installed
$ 

$ brew install freetype
...
/usr/local/Cellar/freetype/2.5.3: 60 files, 2.5M
$ 

$ brew install libpng
Warning: libpng-1.5.18 already installed
$

$ brew install ffmpeg
/usr/local/Cellar/ffmpeg/2.1.4: 184 files, 34M

$ 

uki@.. Frameworks $  pip install matplotlib
-bash: pip: command not found
uki@.. Frameworks $ sudo easy_install pip
Password:
...
Best match: pip 1.5.4
...
Finished processing dependencies for pip
$  pip install matplotlib
Requirement already satisfied (use --upgrade to upgrade): matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Cleaning up...
$ 
$ brew install gdal
...
Error: Homebrew doesn't know what compiler versions ship with your version
of Xcode (5.1.1). 
These open issues may also help:
libxml2 failed to build on 10.9.2 (https://github.com/Homebrew/homebrew/issues/28631)
$ 

$ brew install GEOS
...
/usr/local/Cellar/geos/3.4.2: 385 files, 8.4M, built in 2.2 minutes
$ 

$ brew install sqlite3
Warning: sqlite-3.8.3 already installed
uki@.. Frameworks $ 

$ brew install PROJ
Warning: proj-4.8.0 already installed
$ 





As an Amazon Associate I earn from qualifying purchases.

Install QGIS to visualize GeoJSON

Give it a try in Terminal
$ brew install qgis
Error: No available formula for qgis 

No problem, you will find most of the needed frameworks here:


In addition to Mac .dmg files available above I am providing few Terminal commands you might need:


$  brew install gfortran
...
/usr/local/Cellar/gfortran/4.8.2: 960 files, 113M
 $ 

$ brew install pkg-config
Warning: pkg-config-0.28 already installed
$ 

$ brew install freetype
...
/usr/local/Cellar/freetype/2.5.3: 60 files, 2.5M
$ 

$ brew install libpng
Warning: libpng-1.5.18 already installed
$

$ brew install ffmpeg
/usr/local/Cellar/ffmpeg/2.1.4: 184 files, 34M

$ 

uki@.. Frameworks $  pip install matplotlib
-bash: pip: command not found
uki@.. Frameworks $ sudo easy_install pip
Password:
...
Best match: pip 1.5.4
...
Finished processing dependencies for pip
$  pip install matplotlib
Requirement already satisfied (use --upgrade to upgrade): matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Cleaning up...
$ 
$ brew install gdal
...
Error: Homebrew doesn't know what compiler versions ship with your version
of Xcode (5.1.1). 
These open issues may also help:
libxml2 failed to build on 10.9.2 (https://github.com/Homebrew/homebrew/issues/28631)
$ 

$ brew install GEOS
...
/usr/local/Cellar/geos/3.4.2: 385 files, 8.4M, built in 2.2 minutes
$ 

$ brew install sqlite3
Warning: sqlite-3.8.3 already installed
uki@.. Frameworks $ 

$ brew install PROJ
Warning: proj-4.8.0 already installed
$ 





As an Amazon Associate I earn from qualifying purchases.

PostgreSQL: postGIS functions

Change to Posgres (database user)

pi@raspberrypi /home/uki $ su postgres
Password: 
postgres@raspberrypi:/home/uki$

Select correct database

postgres@raspberrypi:/home/uki$  psql -d polygons
psql (9.1.12)
Type "help" for help.

polygons=#

To exit PostgreSQL shell



polygons=# \q

Select number of Points per Polygon in database


polygons=# select ST_NPoints(polygon) from polygon;

107ms on Respberry Pi

 st_npoints
------------
        132
        132
         12
          6
         26
         57
         15
          6
         18
         26
         19
          8
          6
          6
         14
         13
         10
         58
         10
          8
        171
        171


Select polygons for the GEO point



polygons=# select ST_NPoints(polygon) points from polygon where ST_Contains(polygon, ST_GeomFromText('POINT(-89.2535979 37.9210949)'));

Alternatively you can run query from Linux user prompt


postgres@raspberrypi:/home/pi$ psql -d polygons -c 'select ST_NPoints(polygon) from polygon;' 


If you testing timing of your query then you have to turn it on


polygons=# \timing

Timing is on.
polygons=# select ST_NPoints(polygon) from polygon;
Time: 17.256 ms


As an Amazon Associate I earn from qualifying purchases.

PostgreSQL: postGIS functions

Change to Posgres (database user)

pi@raspberrypi /home/uki $ su postgres
Password: 
postgres@raspberrypi:/home/uki$

Select correct database

postgres@raspberrypi:/home/uki$  psql -d polygons
psql (9.1.12)
Type "help" for help.

polygons=#

To exit PostgreSQL shell



polygons=# \q

Select number of Points per Polygon in database


polygons=# select ST_NPoints(polygon) from polygon;

107ms on Respberry Pi

 st_npoints
------------
        132
        132
         12
          6
         26
         57
         15
          6
         18
         26
         19
          8
          6
          6
         14
         13
         10
         58
         10
          8
        171
        171


Select polygons for the GEO point



polygons=# select ST_NPoints(polygon) points from polygon where ST_Contains(polygon, ST_GeomFromText('POINT(-89.2535979 37.9210949)'));

Alternatively you can run query from Linux user prompt


postgres@raspberrypi:/home/pi$ psql -d polygons -c 'select ST_NPoints(polygon) from polygon;' 


If you testing timing of your query then you have to turn it on


polygons=# \timing

Timing is on.
polygons=# select ST_NPoints(polygon) from polygon;
Time: 17.256 ms


As an Amazon Associate I earn from qualifying purchases.

apt quotation..