Projects

Geospatial Portal
REST Web Service Framework
Metadata Navigator


Summary
Geospatial Portal is a web site developed deployed by Mecklenburg County GIS (here). It is written in standard HTML and JavaScript and is based entirely on web services – OGC WMS services for mapping, and custom REST services for data query and spatial analysis. JSONP is used for the REST transactions, making the application entirely portable – drop it anywhere that has access to the web and it should “just work” ™. It uses jQuery for AJAX and Javascript animations and OpenLayers for map rendering and interaction.

It is released in its entirely so you can better see how the code works and use any or all of the code to create your own web mapping framework. The code is released under the MIT X11 free software license (GPL compatible). You are free to use it and modify it as you wish. Release notes are included in the zip file.

Download
GeoPortal 2.4.0

Version History

2.4.0
Quite a bit has changed in this release, and since I’m making up these version numbers anyway, I thought I’d go to 2.4.0. I went back to jQuery UI for a lot of the tools. I was going to have to keep UI for a slider anyway, and I decided I liked the UI accordions a bit better, and so on. jQuery Tools is still used for lightbox effects, photo galleries, and tooltips. I’m using jQuery UI Layout for the layout now, and I curse myself for not finding this library before. It makes life much easier, and now a decent looking print page comes out of the back end. I moved the right sidebar to a tab on the left (some click counts showed people rarely used it), and I replaced the miriad search boxes with one prominently placed ubersearch that searches and autocompletes on everything (I’ll blog about how I’m doing that at some point). That required a new autosuggest function that I tweaked a bit. I re-themed everything in a nice blue that’s more easy to tweak for other users. Plus lots of code cleanup and such – I think even with all these chagnes there’s less code and HTML than before. Turned the house photo popup into an image gallery via jQuery Tools. Basically it hides all but the first image from the accordion and creates a gallery in the popup. Cool effect and not much code. Plus lots of little tweaks.

2.3.0
The big change here is swapping out the jQuery UI library for jQuery Tools, which is smaller and quicker (my subjective experience). That led to dumping the theme switcher, but over time I ran across nobody that actually used it. The only real user interface changes are the look and the widget maps are now built in under the map, so users don’t have to figure out where to drag the popup windows to. Also some general tweaks and fixes.

2.2.0
There have been so many changes since the last release I fear I’ve forgotten a lot of them (yes I know, should be using version control). Moved to OpenLayers 2.8, which really didn’t change anything. I still have to hack the layers list control and compile a custom openlayers library to stick it in the accordion. I refactored the reporting code, shaving out about 300 lines of javascript. I added a customized jQuery UI theme selector, and then had to tweak CSS so it looked reasonable in all the themes. Even lazier load the GM and VE map widgets. Added a nice tooltip. Various other tweaks I can’t remember.

2.1.2
Added a dialog warning for IE6 users (die ie6!). Moved the tutorial video to youtube and link to it there, getting rid of an iframe, the flash player stuff, the tutorial video HTML page, etc. Let google worry about the bandwidth :) . I also changed some arguments that used the term “long” for longitude to “lon”, as I got tired of Komodo Edit pointing out to me that, yes, I was an idiot for using a data type as a variable name. I Also added some bling with text box highlighting, accordion bouncing, and new graphics and theme.

2.1.1
Aside from getting all the tabs lined up in default.htm, the only change here is to use Google’s CDN for the jquery and jquery ui libraries, as well as the jquery UI theme.

2.1.0
The principal updates here have to do with upgrading to jQuery 1.3.2 and jQuery UI 1.7. Those updates led to small changes all over the place, but the general effect is simplification of code in a number of places (particularly in default.htm – quite a few less tags). In addition, I was able to dispense with one JS library, and I did some minor layout adjustments. There are three different jQuery UI themes in the styles folder. You should be able to stick any jQuery UI theme in and it will style the tabs/slider/dialogs accordingly.

2.0.0
Lots of changes. The layout and look is a lot different for starters, with nary an IE hack in site (aside from transparent PNG’s for the dreaded IE6). I started using jQuery UI for a lot of controls, like accordions, tabs, sliders, and dialogs. I had to hack the OpenLayers layerswitcher.js control to put it in the sidebar, as it looks like most of its styling is hard coded – be ye forewarned if you try your own OpenLayers lib. I added an overlay map, fading sidebards, and jQuery slider toggled overlay transparency. Lots of little cleanups and tire-kicks.

1.9.0
Lots of under-the-hood changes. Upgraded to OpenLayers 2.7 (woot!). Completely refactored the marker/popup code to make it much cleaner and simpler, added identify marker, and started using the framedcloud popup type. Refactored the identify code/event as well and got rid pan/zoom hacks for it (required a couple more includes for the openlayers.js build, found in the gp.conf file). Made the map full screen without the old resize hacks. Usual tweaks and bug fixes.

1.8.1
Added some data related to transit (bus stops, rail stops, park & rides).

1.8
The only visible change here is the additional search options – full address with autocomplete, intersection search with street name autocomplete, and street name search with autocomplete. On the coding end, the autocomplete script was replaced with a jQuery script from www.pengoworks.com, which is a customized versoin of Dylan Verheul’s jQuery script. I in turn hacked the pengoworks script up to process JSONP responses rather than plan text. I also created a generic table generator function to handle about half of the JSON responses (the other half having embedded images and funny logic). Plus your usual tweaks.

1.7.2
Performed some code refactoring to clean things up a bit and add more documentation, along with moving many 1-call JSON handlers from utilities.js to directly where they are called in page.js (facepalm on how I had it before). Made prettier tables. Also fixed a bug that could occur when weather radar was turned on and your browser widow maxed out (weather service only accepts image requests below a certain size).

1.7.1
Started using a jQuery plugin to lazy load the VE and Google Map libraries, speeding initial page load. Performed some code refactoring to clean things up a bit and add more documentation, along with moving many 1-call JSON handlers from utilities.js to directly where they are called in page.js (face palm on how I had it before). Made prettier tables. Also fixed a bug that could occur when weather radar was turned on and your browser widow maxed out (weather service only accepts image requests below a certain size). Few additional tweaks here and there.

1.7
The big changes with this rev are the Google Maps Streetview map widget and the video tutorial piece using Flowplayer. Other changes include some tweaks and bug fixes, as well as consolidating widget pan/zoom/creation into one function. Note for Google Street View you’ll need to alter the API key in default.htm, unless you’re fond of pop-up messages from Google.

1.6.3
Purely IE hacks. Die IE. Die.

1.6.2
Nicer icon set for the environment tab.
Cleaned up the javascript a little, moving all global variables to page.js, renaming json_processor.js to utilities.js and transferring general functions to it.
Added some checks to the environment tab that only my jurisdiction would care about.

1.6.1
Tweaked the VE plugin a bit. I made it so the VE map is created the first time it is made visible, and I made
the link to the OpenLayers map pan/zoom to VE only active if the VE widget is visible. This cuts down some overhead to startup time and pan/zoom navigation time when the VE widget isn’t turned on.

1.6
Changed the layout to make the map cover the whole page.
Added a Virtual Earth map widget and tied it to page navigation.
Add a print stylesheet. It isn’t beautiful, but it prints.
Added some things nobody by my jurisdiciton cares about (few additional layers, some additional tabular data, etc.). Various tweaks and bug fixes.

1.5.1
A couple of bug fixes, notably an IE 6 rendering problem and a Yahoo! traffic problem
Now uses Google AJAX Libraries API to load jQuery

1.5
Made liquid 100% layout.
Changed back to standard popup cloud type due to popup HTML click firing map click
Added Yahoo traffic layer (commented out in code – needs proxy to work correctly)
Added weather radar WMS service
Changed base layer to point at GeoWebCache (8.2)
Little tweaks and fixes

1.4
Upgraded OpenLayers to 2.6 (custom build)
Changed popups to new FramedCloud type
Removed marker for ID – FramedCloud is clear enough without it
Added zoom image effects to layers

1.3
Moved main layer from Tilecache to Geowebcache
Moved envirnoment layer from tilecache to straight GeoServer (1.6.2 is powerful fast and layer isn’t used often)
Fixed future problem with voting tab (PostgreSQL 8.3.1 requires a cast to join tables on varchar/integer fields)

1.2
Even more openlayers.js squishing
General code cleanup and some IE 6 hacks

1.1
Custom OpenLayers javascript build

1.0
Initial Release

Future Work Items

  • Nice page for printing
  • Current weather conditions and air quality information


REST Web Service Framework

Summary
The REST Web Service Framework is a PHP based web service framework designed to provide a series of spatial analysis web services via a PostgreSQL/PostGIS back end, as well provide a framework for creating additional web services, both spatial and non-spatial. The included spatial web services are fully documented and include services that will:

  • Perform attribute queries
  • Buffer points
  • Buffer features
  • Perform point overlays
  • Perform feature overlays
  • List layers
  • List fields
  • Get feature extents
  • Project coordinates

Output is user specified as part of the REST call and can be either XML, JSON, or JSONP. Some non-spatial web services, such as geocoding and CAMA information retrieval, are schema specific and are only included as examples – you’ll need to tinker with those to get them to work with your data. The geo_ services are abstract and should work with your data without modification.

The code is released under the MIT X11 free software license (GPL compatible). You are free to use it and modify it as you wish. A readme file is included in the download.

Download
REST Web Service Framework v2.0

Version History

2.0
Converted from ADODB to PDO
Added more services

1.1
Added JSONP capabilities to the json.inc.php json processor
Fixed a bug in the buffer code

1.0
Initial release

Future Work Items

  • Convert 3rd party (Google, Yahoo!, etc.) XML formats to JSON

Summary

This is an extremely simple metadata search site, consisting of a single page, your metadata xml files, some PHP libraries, some duct tape, and no small amount of swearing. To summarize, it’s a hack in every sense of the word. But it works :) . The main features are:

  • Search metadata via whatever elements you like, or do a full text search.
  • Shows the latest adds/edits.
  • RSS feed for latest adds/edits.
  • Shows metadata in 3 different styles (summary, FGDC Classic, FGDC FAQ) and raw XML.
  • Shows map if WMS URL is in metadata.

Credit for the theme goes to Wolfgang on OSWD.

To run it, you’ll need:

  • A web server with PHP enabled
  • The php_xsl and php_curl extensions enabled.

Once you dump the folder on your web server, your next steps are:

  • Edit the path to your Metadata folder in mn_ini.php.
  • Dump your metadata XML files into the metadata folder (there are quite a few there you can use to test).

The code is released under the MIT X11 free software license (GPL compatible). You are free to use it and modify it as you wish.

Download

Metadata Navigator v1.2

Version History

1.2
Bug Fix: Added some styling for Classic and FAQ in layout_text.css.
Bug Fix: Changed URL representations in Classic and FAQ so humungus WMS URL’s didn’t run all over the page.
Bug Fix: Clean some of the comments and get rid of some extra stuff.
Bug Fix: Readme doc didn’t mention needing the php_curl library for the map viewer.

1.1
Bug Fix: Added “you need the PHP XSL extension” to the docs. I have to file leaving that tidbit out in the “I’m a moron” category.
Bug Fix: Removed a hard path in services/ws_metadata_latest.php.
Bug Fix: Added a try/catch block to the search code in services/ws_metadata_search.php to work around an IE6 error. Damn you IE6.
New: On the summary metadata view, the page will catch onlink WMS links (tests for HTTP and WMS in the tag) and create a OpenLayers viewer with identify features. WMS URL, layer name, SRS, extent, and style are captured via the URL. The only thing you may have to tweak is the maxResolution in the mapgen function – it’s currently set to ~ a county’s worth. Fucntionality was tested with GeoServer.
1.0
Initial release. Kludgy :) .

1.1
Bug Fix: Added “you need the PHP XSL extension” to the docs. I have to file leaving that tidbit out in the “I’m a moron” category.
Bug Fix: Removed a hard path in services/ws_metadata_latest.php.
Bug Fix: Added a try/catch block to the search code in services/ws_metadata_search.php to work around an IE6 error. Damn you IE6.
New: On the summary metadata view, the page will catch onlink WMS links (tests for HTTP and WMS in the tag) and create a OpenLayers viewer with identify features. WMS URL, layer name, SRS, extent, and style are captured via the URL. The only thing you may have to tweak is the maxResolution in the mapgen function – it’s currently set to ~ a county’s worth. Fucntionality was tested with GeoServer.

1.0
Initial release. Kludgy :) .

  • Share/Bookmark