Storing some geospatial data. Following the steps documented in Postgis documentation here. I have used pgadmin for accessing postgresql but psql will suffice too. I recommend pgadmin as it lets you see the spatial structures much more easily. Step 1 - Create some normal table CREATE TABLE roads ( road_id INTEGER, road_name VARCHAR ); Step 2 - Add a special column for spatial data SELECT AddGeometryColumn( 'roads', 'roads_geom', -1, 'GEOMETRY', 2 ); The 2 at the end of the sql command indicates the dimension of the geometry. Step 3 - Add some data BEGIN; INSERT INTO roads (road_id, roads_geom, road_name) VALUES (1,ST_GeomFromText('LINESTRING(191232 243118,191108 243242)',-1),'Jeff Rd'); INSERT INTO roads (road_id, roads_geom, road_name) VALUES (2,ST_GeomFromText('LINESTRING(189141 244158,189265 244817)',-1),'Geordie Rd'); INSERT INTO roads (road_id, roads_geom, road_name) VALUES (3,ST_GeomFromText('LINESTRING(192783 228138,192612 229814)',-1),'Paul St'); INSERT INTO roads (road_id, roads_geom, road_name) VALUES (4,ST_GeomFromText('LINESTRING(189412 252431,189631 259122)',-1),'Graeme Ave'); INSERT INTO roads (road_id, roads_geom, road_name) VALUES (5,ST_GeomFromText('LINESTRING(190131 224148,190871 228134)',-1),'Phil Tce'); INSERT INTO roads (road_id, roads_geom, road_name) VALUES (6,ST_GeomFromText('LINESTRING(198231 263418,198213 268322)',-1),'Dave Cres'); COMMIT; You can view the data from some postgis enabled application like uDIG or JGrass. Related posts: [1]Installing PostgreSQL and PostGIS - Part 1 [2]Installing PostgreSQL and PostGIS - Part 2
July 29, 2009
Installing PostgreSQL and PostGIS - Part 3
Installing PostgreSQL and PostGIS - Part 2
The previous step was [1].
Now installing postgis 1.4. Actually this consists of copying some dlls and running some scripts for creating spatial datatypes and functions.
My database name is deneme.
Installing
Step 1
Downloaded postgis and unzipped it, copied everything to the postgresql installation directory.
Step 2
Ran some sql scripts using psql. Followed the steps in postgis documentation here...
That was all...
Part 3 is for loading some data...
[1] Installing PostgreSQL and PostGIS - Part 1
Now installing postgis 1.4. Actually this consists of copying some dlls and running some scripts for creating spatial datatypes and functions.
My database name is deneme.
Installing
Step 1
Downloaded postgis and unzipped it, copied everything to the postgresql installation directory.
Step 2
Ran some sql scripts using psql. Followed the steps in postgis documentation here...
That was all...
Part 3 is for loading some data...
[1] Installing PostgreSQL and PostGIS - Part 1
Difference between WCS, WMS and WFS
(Writing this entry hoping it makes clear of a novice GIS developer like me)
First the terminology...
WMS - Web Map Service
This service only serves image files, nothing else. You get pngs,gifs, jpgs or tiffs. You can also display coverage data but your actual data is mapped to imagery. For example, in geoserver, you can actually serve bathymetry (elevation including seas) data in geotiff to clients, but your coverage data including elevation is mapped to RGB data in png.
WCS - Web Covarage Service
From the introduction part from OGC 's WCS Implementation Standart Document.
First the terminology...
WMS - Web Map Service
This service only serves image files, nothing else. You get pngs,gifs, jpgs or tiffs. You can also display coverage data but your actual data is mapped to imagery. For example, in geoserver, you can actually serve bathymetry (elevation including seas) data in geotiff to clients, but your coverage data including elevation is mapped to RGB data in png.
WCS - Web Covarage Service
From the introduction part from OGC 's WCS Implementation Standart Document.
The Web Coverage Service (WCS) supports electronic retrieval of geospatial data as "coverages" – that is, digital geospatial information representing space-varying phenomena.
A WCS provides access to potentially detailed and rich sets of geospatial information, in forms that are useful for client-side rendering, multi-valued coverages, and input into scientific models and other clients. The WCS may be compared to the OGC Web Map Service (WMS) and the Web Feature Service (WFS); like them it allows clients to choose portions of a server's information holdings based on spatial constraints and other criteria.
Unlike the WMS [OGC 06-042], which portrays spatial data to return static maps (rendered as pictures by the server), the Web Coverage Service provides available data together with their detailed descriptions; defines a rich syntax for requests against these data; and returns data with its original semantics (instead of pictures) which may be interpreted, extrapolated, etc. – and not just portrayed.
Unlike WFS [OGC 04-094], which returns discrete geospatial features, the Web Coverage Service returns coverages representing space-varying phenomena that relate a spatio-temporal domain to a (possibly multidimensional) range of properties.
July 22, 2009
Installing PostgreSQL and PostGIS - Part 1
(This post is all about my Windows XP experience... Note that under normal conditions postgresql installer should work just fine, my situation is an exceptional case, I guess )
I have been trying to install PostGIS. I have encountered some issues which may be helpful for others. I have not yet been successfull, as I will update this post as a log of my status.
Take 1 - Downloaded PosgreSQL 8.4 and installed it. Postgresql comes with a tool called Stack Builder which lets you install additional components. Postgis can be installed this way, they say. I have chosen in the list and saw spatial node. Chose postgis 1.3.6 and a mirror service for download. It downloaded successfully, started installing and bingo, it is not compatible with postgresql 8.4. Then why in the hell is it listed in the stack builder at first place.
Take 2 - Uninstalled 8.4, installed 8.3. Same steps... When I ran Stack Builder I have detected that 8.3 server is not running, erronous installation. Uninstalling again, going thru regedit, deleting all keys for postgresql, and trying to reinstall 8.3. Uhhh, not worked again, I guess I will have to restart $%#$%#$%.
Take 3 - Restarted. No change. Now took a different path. I have downloaded the zip file of the PostgreSQL 8.4.1 and unzipped it.
Creating the database
I have created a database using the command line tool createdb;
createdb deneme
Give full rights to this directory for the user postgresql database will run under(in my case this is the user postgres).
Running postgresql
In standart case postgresql can not be run under administrative user for security reasons. For this reason you should use runas command from the command prompt.
I tried to run the postgresql from command line using the command :
postgres -D ..\data and have encountered an error. -D indicates the data directory for the postgresql.
Tried this instead;
runas /env /user:postgres "postgres -D ..\data".
You can use absolute paths here.
That's all.
I have been trying to install PostGIS. I have encountered some issues which may be helpful for others. I have not yet been successfull, as I will update this post as a log of my status.
Take 1 - Downloaded PosgreSQL 8.4 and installed it. Postgresql comes with a tool called Stack Builder which lets you install additional components. Postgis can be installed this way, they say. I have chosen
Take 2 - Uninstalled 8.4, installed 8.3. Same steps... When I ran Stack Builder I have detected that 8.3 server is not running, erronous installation. Uninstalling again, going thru regedit, deleting all keys for postgresql, and trying to reinstall 8.3. Uhhh, not worked again, I guess I will have to restart $%#$%#$%.
Creating the database
I have created a database using the command line tool createdb;
createdb deneme
Give full rights to this directory for the user postgresql database will run under(in my case this is the user postgres).
Running postgresql
In standart case postgresql can not be run under administrative user for security reasons. For this reason you should use runas command from the command prompt.
I tried to run the postgresql from command line using the command :
postgres -D ..\data and have encountered an error. -D indicates the data directory for the postgresql.
Tried this instead;
runas /env /user:postgres "postgres -D ..\data".
You can use absolute paths here.
That's all.
Related posts: [1] Installing PostgreSQL and PostGIS - Part 2
[2] Installing PostgreSQL and PostGIS - Part 3
June 10, 2009
Setting up World Wind, JOGL and Eclipse Galileo
World Wind lets you zoom from satellite altitude into any place on Earth. It is like an open source Google Earth. To run the examples, and to play with World Wind you should have a OpenGL compatible graphics card. World Wind comes in two flavors, namely for .NET and for Java.
You can download the Java release from here.
For Java you will also need JOGL libraries for OpenGL support. JOGL is in fact JNI interfaces for direct access to OpenGL hardware.
You can get JOGL from here. Choose your platform as it is available for many platforms like linux and mac.
I wanted to compile world wind from scratch. I installed latest release candidate of Eclipse Galileo and created a new java project and used the World Wind src directory as the source.
To compile the WOrld WInd you should add the JOGL libraries as external jars to the project.
This will be enough to compile the World Wind source tree but not enough to run the examples. To run the examples you should point the JNI interface library path to the JVM [1]. Create a "Run Profile" and in the Arguments tab -> VM arguments paste this.
-Djava.library.path=E:\jogl-1.1.1-windows-i586\lib
The path should change according to your JOGL installation directory.
That's it.
References:
[1] http://www.jagoharry.co.uk/using-jogl-and-swt-in-eclipse-java-projects/
[2] https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=9260&expandFolder=9260&folderID=0
[3] http://worldwind.arc.nasa.gov/
You can download the Java release from here.
For Java you will also need JOGL libraries for OpenGL support. JOGL is in fact JNI interfaces for direct access to OpenGL hardware.
You can get JOGL from here. Choose your platform as it is available for many platforms like linux and mac.
I wanted to compile world wind from scratch. I installed latest release candidate of Eclipse Galileo and created a new java project and used the World Wind src directory as the source.
To compile the WOrld WInd you should add the JOGL libraries as external jars to the project.
This will be enough to compile the World Wind source tree but not enough to run the examples. To run the examples you should point the JNI interface library path to the JVM [1]. Create a "Run Profile" and in the Arguments tab -> VM arguments paste this.
-Djava.library.path=E:\jogl-1.1.1-windows-i586\lib
The path should change according to your JOGL installation directory.
That's it.
References:
[1] http://www.jagoharry.co.uk/using-jogl-and-swt-in-eclipse-java-projects/
[2] https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=9260&expandFolder=9260&folderID=0
[3] http://worldwind.arc.nasa.gov/
May 26, 2009
Thumbs down for Copernic Desktop Search.
I have been a fan of Copernic Desktop Search over MS, Google for a long time, but the glitches that seemed to be bugs never get fixed. To give an example, I searched for email from one of my colleagues and CDS only lists 6 of them. In fact I have 50+ of them in my Outlook. Somehow CDS ignores them.Maybe I haveto buy the CDS pro version to get my emails indexed properly :).
I had to switch to MS Desktop search, unfortunately. For the emails it seems more robust.
What I liked in CDS was ease of use, ability to show the searched keywords highlighed in its built-in editor, which I can push aside for a reliable functioning.
I had to switch to MS Desktop search, unfortunately. For the emails it seems more robust.
What I liked in CDS was ease of use, ability to show the searched keywords highlighed in its built-in editor, which I can push aside for a reliable functioning.
Subscribe to:
Posts (Atom)