Saturday, January 24, 2009
Project Progress update 1/24/2009
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
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
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:

Thursday, January 8, 2009
Using JSON for data transfer
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 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
Mobile Application Implementation
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
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
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.
Iphone Programming resources
CS193P - Stanford iPhone programming class lecture notes and other information
http://www.stanford.edu/class/cs193p/cgi-bin/index.php
iPhone development blog (3rdparty)
http://icodeblog.com/
Apple iPhone Dev Center
http://developer.apple.com/iphone/
Getting started video
http://www.wonderhowto.com/how-to/video/how-to-get-started-with-iphone-programming-in-cocoa-184437/


