Saturday, January 24, 2009

FeatureServer and OpenLayers information

FeatureServer is an implementation of a RESTful Geographic Feature Service. Using standard HTTP methods, you can fetch a representation of a feature or a collection of features, add new data to the service, or delete data from the service. Use it as an aggregator -- post your GeoRSS feeds to it, and then browse them using WFS. Use it as a translator: use the OGR DataSource to load a shapefile and open it in Google Earth.

This software also is able to use a PostGIS as it's storage and information mechanism. In addition to this, there are several options for input/output:

  • GeoJSON -- input and output in the emerging GeoJSON specification. FeatureServer supports GeoJSON Points, Lines, and Polygons with Rings, as both input and output.
  • GeoRSS Atom (Simple) -- input and output of Points/Lines/Polygons (no rings/holes) in GeoRSS Simple (Atom). This allows one to take any GeoRSS Simple Atom feed and feed it to FeatureServer for storage.
  • KML -- Input and output of Points, Lines, and Polygons from KML.
  • GML/WFS -- Output-only support of WFS/GML.
  • HTML -- Output-only support of features as HTML files, powered by Cheetah templates.
  • OSM -- Output-only support of features as OpenStreetMap '.osm' files. (These files can be opened using JOSM and posted to the OSM server.)
Since the iPhone is very capable of reading the JSON data format and it is very useful for tabular data. I have already discusses using JSON earlier in the semester with Robert Kosara and he seems to think that it would be a very efficient and easy way to transfer data to the iPhone. Plus there are several programs available that read data from JSON for the iPhone, such as TouchJSON which can be found at this link: http://code.google.com/p/touchcode/.

As soon as I am able to get a test machine up and running with the new version of Postgresql I will be able to install these things and test them out. Then we can begin developing methods to transfer this information over to a format that will be displayed properly on an iPhone.

The image below shows the framework of the featureserver and the many storage and input/output options:



Project Progress update 1/24/2009

This week I have been able to acquire the CAD data files for the College of Education at UNCC. I have been through the process of "cleaning" up these data files for use in our database and for our automation program. This process allowed me to delete and filter out all polygons and other bits of data that were either erroneous or not useful. After this was finished I was able to take each floor and geo-reference it to the base map in order to put it in the correct coordinate system for this project.

The current building files are now located in our GIS database as spatial data files that have been converted from shapefiles. They are now in the proper format to be read by Jianfei's automated centerline program to make paths inside the building.

Other things that have been done are: setting up and test the new version of Postgresql on my Windows box. This has allowed me to install the pgPhoneHome iPhone web application that will allow us to mainipulate our database from the iPhone. This will hopefully provide a first step in our mobile application.

I have also come across a useful project called FeatureServer. It is basically a implementation of a RESTful Geographic Information feature service. I will be posting more information about this service and all of the details in a later blog post.

Centerline Extraction for Convex Polygons

Jianfei has been working on the center line extraction for polygons which will serve as the routes in our building files. This will hopefully allow us to fully automate the pathways creation inside of buildings if we are able to accoplish the automation effectively.

From email from Jianfei Liu on January 21st, 2009:

I extracted centerlines from convex polygons this week. Snapshots are some results. For the concave polygon, it just needs a little extension to my existing framework. The current framework can handle certain concave cases except for one situation I neglected. I decided to design a more robust evaluation model to determine the polygon's type. In the results, the sphere means the vanishing point and the centerline is represented as the yellow line. In certain cases, the centerline is just one point.

Below are the snapshots from the centerline extraction from the above email:








Friday, January 16, 2009

Implementation of phPhoneHome for remote iPhone connections

I have come across the phPhoneHome program for Postgresql that will allow me to administer the NIJ database from an iPhone. This should provide a useful starting point for our mobile application and should let us start sending/receiving data between the device and the server.

The program is installed as part of stackbuilder on the Enterprise DB installation, which is located at: http://www.enterprisedb.com/begin-download.do?redirectReason=startDownload . The application isn't really an application in essence, but a way to format the administrative tools for use on the iPhone.

The program was created by Dave Page who has an interesting and useful blog at: http://pgsnake.blogspot.com/ . Dave works for EnterpriseDB and developed the Iphone application that I will be using. His blog is a useful source of information for Postgresql information that I hope to use more of in the future.

Currently I am trying to get the server running on my Windows box since I have to get Scott Wood to do the install on our main DB server. At the moment, things don't seem to be working correctly and my server isn't recieving incoming connection on TCP/IP. Once i have this problem resolved I should be able to load the iPhone interface and try to test sending quieries and updates via SQL to the server.

Below are some screenshots that show how pgPhoneHome looks and works:


This show the main interface with all the tools available for use




This next screenshot show the server information once a connection is established.


Thursday, January 8, 2009

Using JSON for data transfer

Robert Kosara pointed out that using JSON would be a good way to get data from our database to the iPhone. One application in particular has been implemented for the iPhone which is called TouchJSON. The link to that web site is: http://code.google.com/p/touchcode/wiki/TouchJSON.

The idea behind this is to have something that is easy to use and supported from multiple languages. As soon as I am able to build and test code, I will try to implement some of these programs to see if I can recieve data from the database. This method can also be used to send data I believe, which will prove to be very usefull in the future.

Saturday, December 27, 2008

Iphone application development

I have recently been researching how we can implement our application on the mobile device. Since we are using an Iphone for a testbed it has become an interesting problem on how to use OpenGL and Objective-C to transfer our program to this device.

I have found some great resources related to these problems and some sample code that should be of great use to us. Below are some links that I am posting as a reference later on when I will actually implement the program on the mobile device.

/* This link is sample code for GLSprite. The GLSprite sample application shows how to create a texture from an image. By looking at the code, you can learn how to use Core Graphics to create a bitmap context and draw an image into the context. You can then see how to use OpenGL ES to create a texture from the image data.

This application is built on the Cocoa Touch OpenGL Application template. Instead of using GL_COLOR_ARRAY as provided in the template, GLSprite renders a texture. The textured sprite in the application rotates using the timer that's provided with the template. */

http://developer.apple.com/iphone/library/samplecode/GLSprite/index.html

/* XMLPerformance -- This sample explores two approaches to parsing XML, focusing on performance with respect to speed, memory footprint, and user experience. The XML data used is the current "Top 300" songs from the iTunes store. The data itself is not particularly important to the sample - it was chosen because of its simplicity, availability, and because the size (approximately 850KB) is sufficient to demonstrate the performance issues central to the sample.

This could be very useful if we can find a way to export the database in a XML format which would be easy to transfer, as well as being less data intensive and non-chatty */

http://developer.apple.com/iphone/library/samplecode/XMLPerformance/index.html

/* LocateMe -- Shows how to use the CLLocationManager class to determine the user's current location. It demonstrates starting and stopping updates, error handling, and changing location parameters.

This can be used to determine a users location that will enable us to provide location based content for the user. Can also be used for tracking users and other possible applications. */

http://developer.apple.com/iphone/library/samplecode/LocateMe/index.html

/*UICatalog -- This sample is a catalog of all the UI elements found in the iPhone's UIKit framework. It is designed to exhibit a large variety of views and controls along with all their varying properties and styles. If you need code to create specific UI controls or views, refer to this sample and it should give you a good head start in building your user interface. In most cases you can simply copy and paste the code snippets you need. */

http://developer.apple.com/iphone/library/samplecode/UICatalog/index.html

/*SeismicXML -- The SeismicXML sample application demonstrates how to use NSXMLParser to parse XML documents. When you launch the application it fetches and parses an RSS feed from the USGS that provides data on recent earthquakes around the world. It displays the location, date, and magnitude of each earthquake, along with a color-coded graphic that indicates the severity of the earthquake. */

http://developer.apple.com/iphone/library/samplecode/SeismicXML/index.html


There are also many other sample apps available that should prove very useful in the development of the NIJ mobile device implementation. These other sample source code and program can be found at:

http://developer.apple.com/iphone/library/navigation/SampleCode.html


Thursday, December 11, 2008

NIJ Project Conceptual Architecture and Data Flow Models

This figure is the conceptual project architecture for the NIJ Project.  This image was adapted from the orignal project proposal by Dr. Jiyeong Lee.  It describes in detail all of the aspects of the project and how data will be inputted and interfaces used.





The next image represents the flow of data from original building CAD file to the final mobile and desktop interfaces.





Mobile Application Implementation

Today I have finished composing a document that details the functionality and goals of the mobile application for NIJ project.  I will include a few of the key details in this post.

Mobile Application Goal

Implement a mobile application to support the operation of a GIS-based intelligent emergency response system (GIERS) (Kwan and Lee, 2005) that uses a 3D geocoding technology for locations in large buildings.  The application will aim to facilitate quick response to emergencies on multi-level structures using existing network technologies.  The mobile application will be a key component in the overall project in order to further the gathering of real-time data to aid in the decision making process.  This will allow emergency managers to respond to emergencies accurately, and evaluate and implement emergency response plans accordingly. 

Along with providing remote data gathering capabilities, the mobile application will serve as a secondary means of communication between dispatchers and emergency responders.  By using informative visualizations we hope to provide a means to guide responders through complex urban structures to points of interest  within the building.  In combination with our desktop application, the mobile application will provide a comprehensive set of tools to reduce the amount of time required to respond to emergencies in large and complex structures.

Functionality

·         Device

o   Provide a UI that is fully integrated for mobile use

o   Use network connections such as Wi-Fi or 3G

o   Effectively visualize key data

o   Useful in an emergency situation

o   Use GPS or cell phone triangulation to locate users

·         Application

o   Allow connection to Postgresql database or web interface

o   Allow editing and viewing of certain data

o   Send/receive data efficiently

o   Display real time information from data source

o   Allow users to easily identify/flag critical information (blocked hallways, stairways, room destinations)

o   Intuitive and easy to use

o   Allow multiple user types with different levels of access

o   Allow self-location of mobile users using GPS or triangulation

o   Allow reporting of different emergency types (fires, flood, chemical spill, etc.)

o   Provide interactive navigational guidance to critical locations 

Sunday, December 7, 2008

Project Update

For the next week or so I will be working on figuring out the conceptual framework and goals of our mobile application. I have been reading through the relevant research articles related to our study and have been finding out different ways to implement a solution.

As mentioned in a previous post, we will most likely be creating some kind of web interface that we will use to manipulate the data sets and allow users to edit things in the environment.

For this week I will be composing a document related to this which will be distributed about to be modified by the PI's and other researchers. It will later be distributed to the researchers at Purdue and other relevant people in hopes that it may generate new ideas on the mobile app implementation.

Wednesday, December 3, 2008

iPhone app implementation

I have been trying to find the best way to implement our application on the iPhone and I have run into a few problems and a variety of different solutions. The main problem with connecting to the database server can be solved by installed an app already written for the iPhone, Mobile Can 2.0. Another option is to install an SSH client to make the connection, and there and several of those are available: iSSH, pTerm, and TouchTerm. Each of these programs are available from the App store for a fee. One large problem arises with using these is that only one application can run at a time on the iPhone unless special software is installed to allow this which requires you to "jailbreak" the iPhone in order to install this app which makes changes to a critical config file. This would not let me take advantage of this software and allow me to "listen" to the outputs of these programs in an external program.

Since this seems to not be a very viable solution, I have trying to find other methods for obtaining data remotely from our database. Another option that I have discovered is a program called phpPgAdmin which is a web based postgresql database administration tool. This would essentially make the database available for updates and modifications just by visiting a web address. This would be much easier to use in the iPhone since no other additional apps would be required to install, and updates (for example blocking a hallway) could be executed by constructing SQL queries and sending them through the iPhone's web interface to the database server. However, this would require that the database server also be a web server with PHP enabled. This means that we would have to get Scott to install the software, as well as enable Apache and PHP for CCID147.

The great thing about using the phpPgAdmin web interface is that any mobile device with access to the internet can make updates to the database, not just the iPhone. This means that any program we write for the iPhone can be ported to another mobile OS (ie. Windows Mobile 6, Android) relatively easy without having to use proprietary iPhone software.

If this is not possible there are other routes that we can take such as creating a REST API to send/receive data. This would also allow for interoperability across multiple platforms other than the iPhone.

I am awaiting an email on whether to proceed with the phpPgAdmin installation.