Sunday, February 8, 2009

Project Update for week of 2/8

During Friday's meeting we discussed several important aspects of the project. While Jianfei has made progress on the centerline extraction algorithm and sampling rates, I had been geo-referencing and preparing the new CAD files as well as updating the database to the new server (CCIS017).

This week I am tasked with completing the database upgrade as well as finally installing the phPhoneHome app so I can test the iPhone communications with our database server. Dr. KR also wanted me to develop a simple iPhone application that makes use of the UI for the iPhone and does some simple functions such as selecting polygons in OpenGL.

In order to do this I need to break apart the code that I currently have that is running the sample OpenGL app and make it render something related to the project. I am sure that I will have to enlist the help of Jianfei and maybe some other people to do this since I am not very good at programming in Objective C or using X-Code. I will try to blog my progress as the week goes on.

Thursday, February 5, 2009

Updated and geo-referenced new CAD files...

Today I have been working on geo-referencing the new CAD files that were sent to us by Fred. The building that were send were the: College of Health and Human Services, College of Education, and the Student Activity Center (SAC). This building are now all geo-referenced and backeup up as polygon features. In addition to this the original CAD files are on the dataserver where they are secure.

These new building files will allow us to set up "urban cluster" scenarios and enable us to start testing our program on different shapes and sizes of building. As well as having new building files, hopefully by the end of the day we will also have a new database server up and running so we can access everything we need.

Here is the latest screenshot from the new geo-referenced CAD files that I have just fixed:



Thursday, January 29, 2009

Implemented PgPhoneHome Web app

Today I finally worked the bugs out of the Postgresql Windows installation and got it up and running. I also resolved the issue with StackBuilder running for Postgresql Plus and was finally able to implement the PgPhoneHome iphone Web application. I have tested it from my local box as well as Jianfei's iPhone and it seems to be working correctly.

Below are a few screenshots of it running in the iPhone simulator on the Mac in the demo lab:


This screenshot shows the home page of phPhoneHome




This screenshot shows the different tools available in the program



This shows the server information



This shows the windows that allows you to exectute SQL queries on your server

Installation of Postgresql Plus on Windows

Just for a reference I am going to post these links to the installation of Postgresql Plus on Windows:

http://www.enterprisedb.com/learning/getting_started.do

This also includes the documentation for installing the server with Apache/PHP support for web applications.

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