for ogr2ogr reference
http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet
http://www.mercatorgeosystems.com/blog-articles/2008/05/30/using-ogr2ogr-to-re-project-a-shape-file/
https://alastaira.wordpress.com/2011/02/21/using-ogr2ogr-to-convert-reproject-and-load-spatial-data-to-sql-server/
for other GIS installation reference
http://scigeo.org/articles/howto-install-latest-geospatial-software-on-linux.html
for centos 6
http://anotherdatabaseblog.blogspot.co.uk/2012/04/installing-mapserv-on-centos-6.html
yum installation of postgres following the steps from
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-7
https://www.digitalocean.com/community/tutorials/how-to-use-roles-and-manage-grant-permissions-in-postgresql-on-a-vps--2
http://postgis.net/docs/manual-2.1/postgis_installation.html#installation_configuration
https://www.a2hosting.com/kb/developer-corner/postgresql/connect-to-postgresql-using-php
this one made postgis working
http://codingsteps.com/installing-and-configuring-postgresql-in-amazon-linux-ami/
how to shp to pgsql
http://gis.stackexchange.com/questions/110854/importing-shp-to-postgresql
how to kml to postgres using ogr2ogr
http://gis.stackexchange.com/questions/33102/how-to-import-kml-file-with-custom-data-to-postgres-postgis-database
[root@localhost enad]# sudo yum install postgresql-server postgresql-contrib
[root@localhost enad]# sudo postgresql-setup initdb
Initializing database ... OK
[root@localhost enad]# sudo vi /var/lib/pgsql/data/pg_hba.conf
Find the lines that looks like this, near the bottom of the file:
pg_hba.conf excerpt (original)
host all all 127.0.0.1/32 ident
host all all ::1/128 ident
Then replace "ident" with "md5", so they look like this:
pg_hba.conf excerpt (updated)
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
Save and exit. PostgreSQL is now configured to allow password authentication.
Now start and enable PostgreSQL:
sudo systemctl start postgresql
sudo systemctl enable postgresql
[root@localhost enad]# sudo systemctl start postgresql
[root@localhost enad]# sudo systemctl enable postgresql
ln -s '/usr/lib/systemd/system/postgresql.service' '/etc/systemd/system/multi-user.target.wants/postgresql.service'
postgis
reference for installation of postgis in postgres9.2
yum installation of apache
from http://www.liquidweb.com/kb/how-to-install-apache-on-centos-7/
Pre-Flight Check
These instructions are intended for installing Apache on a single CentOS 7 node.
I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as non-root user. If you need more information then visit our tutorial on How to Add a User and Grant Root Privileges on CentOS 7.
Step 1: Install Apache
First, clean-up yum:
sudo yum clean all
As a matter of best practice we’ll update our packages:
sudo yum -y update
Installing Apache is as simple as running just one command:
sudo yum -y install httpd
Step 2: Allow Apache Through the Firewall
Allow the default HTTP and HTTPS port, ports 80 and 443, through firewalld:
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
And reload the firewall:
sudo firewall-cmd --reload
Step 3: Configure Apache to Start on Boot
And then start Apache:
sudo systemctl start httpd
Be sure that Apache starts at boot:
sudo systemctl enable httpd
To check the status of Apache:
sudo systemctl status httpd
To stop Apache:
sudo systemctl stop httpd
[root@localhost var]# yum install mapserver
[root@localhost html]# yum install libpng libpng-devel
[root@localhost html]# yum install gd gd-devel
[root@localhost html]# yum install giflib-devel
installation of gdal
http://gis.stackexchange.com/questions/33346/how-can-i-update-ogr2ogr-to-include-the-postgresql-driver
wget gdal-2.0.1.tar.gz
./configure --with-jpeg --with-gd --with-freetype --with-png --with-ogr --with-proj --with-gdal --with-httpd --with-tiff --with-wfs --with-wcs --with-threads --with-wmsclient --with-wfsclient --with-geos --enable-debug --with-gif --with-mysql --with-php-- --with-libtiff --with-static-proj4 --with-pg=/usr/bin/pg_config
make
make install
installation of mapserver7 in centos7
wget mapserver-7.0.0.tar.gz and yum install of dependencies and lotsatweaking
yum install fcgi-devel
yum install postgis-devel
yum install libxml2-devel
yum install postgresql-devel
$ tar -zxvf mapserver-X.Y.Z.tar.gz
Create the build directory and configure your environment.
Create the build directory:
$ cd mapserver-X.Y.Z
$ mkdir build
$ cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt -DWITH_ODBC=0 -DWITH_FRIBIDI=0 -DWITH_HARFBUZZ=0 -DWITH_CAIRO=0 -DCMAKE_PREFIX_PATH="/usr/local;/usr/share/pgsql;/usr/share/pgsql/contrib/postgis-2.0;/usr/lib64;/usr/lib64/httpd/modules;/usr/bin;/usr/sbin;/usr/include;/usr/include/geos;/usr/share/doc/postgis2_93-2.1.8;/usr/share/pgsql/contrib;/var/lib/alternatives;/etc/alternatives" ../>../ configure.out.txt
yum install nmap
https://github.com/wavded/ogre.wiki.git
Clone in Desktop
How to install ogr2ogr from source on CentOS (RHEL)
Install the following packages:
yum install gcc-c++
yum install gcc
yum install libpng
yum install libtiff
Build latest proj4
get the latest proj4
wget http://download.osgeo.org/proj/proj-4.7.0.tar.gz
tar -zvxf proj-4.7.0.tar.gz
cd proj-4.7.0
./configure
make
make install
Build latest gdal
get the latest gdal
wget http://download.osgeo.org/gdal/gdal-1.7.2.tar.gz
tar -zvxf gdal-1.7.2.tar.gz
cd gdal-1.7.2
./configure --with-static-proj4=/usr/local/lib --with-threads --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-png=internal --with-libz=internal
./configure --with-jpeg --with-gd --with-freetype --with-png --with-ogr --with-proj --with-gdal --with-httpd --with-tiff --with-wfs --with-wcs --with-threads --with-wmsclient --with-wfsclient --with-geos --enable-debug --with-gif --with-mysql --with-php-- --with-libtiff --with-static-proj4 --with-pg=/usr/bin/pg_config
make
make install
Making ogr2ogr globally accessible
ln -s /usr/local/bin/ogr2ogr /usr/local/ogr2ogr
still producing error
ERROR 1: ogr2ogr was compiled against GDAL 1.7 but current library version is 1.11
yum install binutils libproj-dev gdal-bin
yum install geos (installed geos 3.4.2)
yum install telnet
https://docs.djangoproject.com/en/1.9/ref/contrib/gis/install/geolibs/
upgrade proj 4.7 to 4.9
$ wget http://download.osgeo.org/proj/proj-4.9.1.tar.gz
$ wget http://download.osgeo.org/proj/proj-datumgrid-1.5.tar.gz
ogr2ogr -f "PostgreSQL" -a_srs "EPSG:900913" -skipfailures -append PG:"host=localhost user=postgres dbname=compassdb password=devpassword" Pncrlrts_font_point.shp
ogr2ogr: error while loading shared libraries: libproj.so.9: cannot open shared object file: No such file or directory
http://gis.stackexchange.com/questions/98/how-to-convert-between-kml-and-esris-shapefile-shp-format
convert kml files to shp file
ogr2ogr -f 'ESRI Shapefile' Bridges.shp Bridges.kml
convert shp file to sql
shp2pgsql -W "Latin1" Bridges.shp Bridges > Bridges.sql
import sql file to postgres
psql -f Bridges.sql mapdata
ogr2ogr -f 'ESRI Shapefile' KM_Post.shp KM_Post.kml
shp2pgsql -W "Latin1" KM_Post.shp KM_Post > KM_Post.sql
psql -f KM_Post.sql mapdata
ogr2ogr -f 'ESRI Shapefile' Railways.shp Railways.kml
shp2pgsql -W "Latin1" Railways.shp Railways > Railways.sql
psql -f Railways.sql mapdata
List of gt data
bridges
cavite_building_footprints
km_post
metromanila_points
railways
roads
trafficlights
waterbodies
sample syntax of postgres import
shp2pgsql -W "Latin1" r050mbnd_region.shp municipal > municipal.sql
shp2pgsql -W "Latin1" shapefile tabname > tabname.sql
psql -f municipal.sql mapdata
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=mydbname password=mypassword" mytabfile.tab
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=mapdata password=devpassword" sample_utm_points.TAB
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=compassdb password=devpassword" sample_utm_points.TAB -nln newtablename
ogr2ogr -f "ESRI Shapefile" Pncrlrts_font_point.shp -s_srs EPSG:27700 -t_srs EPSG:4326
ogr2ogr -f "PostgreSQL" -a_srs "EPSG:900913" PG:"host=localhost user=postgres dbname=compassdb password=devpassword" Pncrlrts_font_point.shp
for shp files
ogr2ogr -f "ESRI Shapefile" -a_srs "EPSG:900913" Pphilrlst_font_point.shp PG:"host=localhost user=postgres dbname=compassdb password=devpassword" "pnr_istasyon"
ogr2ogr -f "ESRI Shapefile" -a_srs "EPSG:900913" PG:"dbname=compassdb user=postgres password=devpassword" "sample_utm_points_point.shp" -skip-failures
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=compassdb password=devpassword" usertable.dbf -nln "sometable"
ogr2ogr -f "PostgreSQL" -a_srs "EPSG:900913" PG:"host=localhost user=postgres dbname=compassdb password=devpassword" Bridges.kml
ogr2ogr -f "kml" neighborhoods.kml PG:"host=localhost user=postgres dbname=compassdb password=devpassword" -sql "select * from bridges"
SELECT AddGeometryColumn ('my_schema','metromanila_points','g_geom',900913,'POINT',2);
alas this one works after re-installation of gdal and proj4(importing kml and xlsx file to postgres)
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=compassdb password=devpassword" sample.kml
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=compassdb password=devpassword" Sample.xlsx
No comments:
Post a Comment