- Edit the httpd.conf file (default path: C:\Apache2.2\conf\httpd.conf). Remove tomcat references to the services (JkMount). Add Redirect 301 lines to .php proxy
- Create php proxy which is referenced by Redirect 301. Arguments are passed by the redirect, which can be handled by this proxy. Here is the code I used for a single argument, but could easily be extended to other arguments. This also saves arguments that are not handled to a log file:
$out = array();
$log = '';
foreach($_GET as $key => $value){
if (strpos($key, 'max')){};
switch ($key) {
case bldgcode:
$out['id'] = $value;
break;
default:
$log .= 'key is ' . $key . ' and value is ' . $value . "\n";
break;
}
}
$fp = fopen('log', 'a');
fwrite($fp, $log);
fclose($fp);
$url = 'http://maps.rdms.udel.edu/map/index.php?' . http_build_query($out);
header("Location: $url");
Thursday, January 13, 2011
Replacing Tomcat .jsp pages with Apache httpd .php pages
It turned out that this task was much easier than I'd expected. Here are the steps I took:
Thursday, December 23, 2010
WHERE NOT IN and NULL in Postgresql
NULL values trip up the WHERE NOT IN condition in Postgres. To fix this behavior, use a conditional (not null) in the subquery.
Wednesday, November 10, 2010
Duplicate OSM Features in UD Campus Map
I noticed a couple places where we have two polygons on top of each other (particularly for parking polygons) in the UD Campus Map. I just wanted to note, if you're trying to modify an existing polygon on the map, make sure that you're changing the existing shape, rather than adding a new one (otherwise we're loosing attributes on the exisiting shape).
Here are two screenshots to demonstrate what I'm talking about (note that only the second polygon retains attribute information/properties as listed in the right-hand sidebar), though it appears the first polygon was intended to replace the second.

I've fixed this problem by adding nodes to the second polygon (the original one that has attributes/properties) and dragging them to match the footprint of the first (new, intended to replace the first), and deleting that one.
Tuesday, November 9, 2010
Zoom to extent of new vector layer in OL
Zooming to the maximum extent of all features in a vector layer does not work unless all features have been loaded. Therefore it is necessary to register an event handler, as demonstrated below ('layer' is any object of class OpenLayers.Layer.Vector):
layer.events.register('featuresadded', map,function(){this.zoomToExtent(layer.getDataExtent())});
layer.events.register('featuresadded', map,function(){this.zoomToExtent(layer.getDataExtent())});
Friday, October 8, 2010
Random Feature Selection
I met with a gentleman today who needed to select random streets in Wilmington in order to do a field survey of urban forestry there. Here are the steps we took to do so:
-Use Excel and the RANDBETWEEN function to generate random numbers in a range = total number of features (in this case, streets in Wilmington). Drag this equation down a column = number of features in sample. Once this has been done, save/export (I usually like to use DBF for ArcGIS)
RANDBETWEEN(bottom,top)
Bottom is the smallest integer RANDBETWEEN will return.
Top is the largest integer RANDBETWEEN will return.
- with data added to ArcGIS, use "Frequency" tool to check that no duplicate values were generated
- do a regular one to one join, dropping out all values that don't match. The result will be a random set of features -- in this case, street segments.
Thursday, October 7, 2010
View KML Source from MyMaps
Google MyMaps allows you to export KML by using the "Export to Google Earth" feature. If you copy/paste the URL that this button links to you get a KML, but it is a network reference to the actual KML. If you copy/paste the URL referenced in this KML in your browser, you'll get a warning "{errorText:"Unable to contact server."}". To get past this warning, you must decode the encoded URL reference. That means getting rid of all the "amp;" strings.
For example, change:
http://maps.google.com/maps/ms?ie=UTF8&hl=en&vps=1&jsv=250a&oe=UTF8&msa=0&msid=113097578162956796020.00048fc123b72558b50ff&output=kml
to
and you'll get the actual kml. You do not need to do this within any script or program, since those tend to encode URLs anyway. However, it is very useful for debugging issues with KML.
Friday, October 1, 2010
Geoserver Labeling, Font Changes
Wierd Geoserver Behavior (bug): font changed from Arial to some kind of serif font for no apparent reason. I fixed this by clearing all caches and restarting the Geoserver service. I'm still not sure what caused the issue.
Subscribe to:
Posts (Atom)