Author Archive for Chris Tweedie

WFS-T adventures with Mapinfo 9.5

So i’ve been a bit late taking a look at the new Mapinfo Professional v9.5. With the consistent dissapointment towards the consumption of OGC standards in commercial apps I wasn’t holding my breath … but wait a sec, it did work and it worked damn well. I mean, it worked flawlessly; updates, inserts, deletes, lock support and it also comes complete with a semi-intelligent conflict manager.

Mapinfo

A few more suggestions to improve things further (for anyone listening~) …

  1. Add HTTP compression handling. Huge performance gains with the transfer of features and its really a no brainer to enable in any http library.
  2. I am by no means a “Mapinfo Master” ™, but it would be great to enable an automated WFS Table refresh especially if you are retrieving features based on CURRENT_MAPPER.  I guess the CTRL+F5 shortcut makes it easy-ish … but i certainly found myself wondering whether i had retrieved the features or not and ended up just sending unnecessary requests.
  3. If a transaction is successful, give me some kind of alert. Alerting only when it fails does not instill much confidence whether my long edit session went through or not (even after refreshing)
  4. It would be fantastic to add helpful warning messages when performance drops. I’d imagine most users would skim over the maxfeatures and column / row filters and just add the layer.
  5. If the first request takes 5 minutes and Mapinfo tells me i just retrieved 4000 poly features totalling 10mb and it kindly directed me to the WFS how-to, i’d be more inclined to see what the filtering options were all about :)

So there’s no WFS1.1 support … but i’m still trying to get my head around handling the axis order issue and are more than happy to let sleeping dogs lie … at least for the moment. I only had time to test against our Geoserver installs, but it certainly seems tested against many other apps including Cadcorp, Ionic & Mapinfo. Geoserver specific here, but the advanced security in 1.6.x works very well with the bundled support for basic authentication.

Finally…

LBS has arrived

Finally a consumer personal navigational device with internet connectivity, meet Dash Express. See also Engadget review.

Dash

The opportunities this opens up to both the Geo community and also Joe Public is quite huge. Enter GeoRSS. Your time to shine has arrived :)

Many websites have geo-relevant content - including, but not limited to, Google Maps, Yelp, Craigslist, Trulia, Gruvr, and many more. Just check the source of the feed to see if there is a latitude/longitude provided for each item in the feed, and if so, the odds are good that it will work as a MyFeed on MyDash.

Hopefully this will continue across the PND market. *fingers crossed* The only downer (apart from the price) ?

It will not work in Canada, Mexico, Europe or any location outside the United States

:(

gvSig mobile release & other thoughts

Seems as though a lot of people missed this release last week.

It gives us great pleasure to announce that the pilot application awarded the development contract for the gvSIG Mobile application by the Regional Ministry of Infrastructure and Transport is available. gvSIG Mobile is a smaller version of gvSIG which has been adapted for use in mobile devices. It supports shapefiles, ECW, WMS and images and is able to make use of GPS systems. Currently, only the visualization of layers and the generation of GPS tracklogs/waypoints are supported.

gvSIG Mobile … available at gvSIG website http://www.gvsig.gva.es

I must thank the gvSIG guys for helping me out with my WALIS Forum presentation by supplying me with a pre-release copy. Implemented a work around in 5mins and had it talking to our SDI straight away. Anyone with a Windows Mobile device, its definately worth checking out and things will become more interesting pending the gvSig and OSGEO talks.

gvsig.jpg

In other news, i am officially slack. But the good news is that i have been harassed by that many people at events and on email that i will begin making a concerted effort posting more regularly now. SO LAY OFF!

WALIS Forum has been and gone for another 18 months. Attendance was the biggest yet, with 820 through the doors. Highlights for me (in no particular order)..

  • Tim trying to do updates throughout the conf but stopping after the first post. Hey, i never said i was going to!
  • Harvey from Microsoft failing miserably trying to demo photosynth live. I feel ya pain buddy, i really do, but we had seen it all before anyway :)
  • Mr Parsons with the usual tidbits of humour. My only feedback would have been tailoring another presentation addressing the “short tail” as 95% of the attendees were the custodians and advanced spatial users. Certainly from my point of view, addressing how Google is tackling this area would have been far more interesting from a GeoWeb perspective! Next time.
  • Leaving a room of 100 people stunned after a presentation but then all saying what a great presentation it was. Hmmmm?
  • Cameron not taking a breath, ever, throughout the 2 day conference. That man can talk.

Where art thou WCS clients?

How can I push a proposal for provisioning elevation data via Web Coverage Services when there are no freakin’ clients?

After a couple of hours I seriously only found,

Suggesting users manually craft the requests is not an option :)

I guess this kinda gets back to my previous rants on this issue. We’ve got Deegree, Geoserver, Mapserver and quite a few other notable suppliers pushing coverages out … to where exactly??

Image courtesy http://www.refractions.net/terrainserver/

It seems absurd how many people grab the whole SRTM/Landsat/DEMs in general just because “its easier”. After looking into WCS, perhaps they are right. Chicken meet egg, again.

Generic Web Proxies

In my quest for increased adoption of geospatial web services, I would constantly bash my head against the wall trying to debug GIS applications. So if you have suffered from “what the” behaviour such as …

  • weird uri encoding
  • apps pretending to talk SSL but only on some requests
  • not supporting BASIC authentication when they say they do
  • clients not sending the required STYLES WMS kvp
  • sending hundreds upon hundreds of chunked requests …

then these scripts/apps may be for you. They are pretty generic and can be applied to any AJAX-type cross-domain restriction. The only OGC specific type line is the string replace of the online resource with the proxy uri (for obvious reasons for the getcapabilities document).

Other recommends ..

  1. For desktop based apps, i highly recommend fiddler2 as man in the middle proxy interceptor for debugging HTTP. It even does HTTPS mitm :)
  2. If you want to enable HTTPS/BASIC authentication on a desktop client that doesnt support it, check out InteProxy or email me for my own “Gismo” command line version. This will allow apps such as GRASS or QGIS which only has standard WMS support to magically start working on these services

But if you are just trying to get your poor OpenLayers application talking to that lonesome WFS server sitting on the interweb, these might come in handy!

Note that these are open proxies by default!

< ?php
	$urlparams = urldecode($_SERVER['QUERY_STRING']);
         $ch = curl_init();
	curl_setopt($ch, CURLOPT_URL,$url."&Styles=");
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);
 	curl_setopt($ch, CURLOPT_USERAGENT, "Openlayers proxy - CTweedie hax"); // Set a different user-agent so we can track usage easier
	curl_setopt($ch, CURLOPT_FAILONERROR,1);
	//curl_setopt($ch, CURLOPT_VERBOSE, 1);
   	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  // the next 3 lines makes it work through https SSL3 with authorization.
	curl_setopt($ch, CURLOPT_SSLVERSION, 3);
	curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
	$data = curl_exec($ch); // Execute query
        $data = str_replace("https://www.wms.com/server/to/reflect/to?","https://www.wms.com/server/proxy?", $data)
        $content_type = curl_getinfo( $ch, CURLINFO_CONTENT_TYPE );
	header('Content-Type: '.$content_type);
	echo $data;
	curl_close($ch);
>

Python equivalent … almost identical to the OpenLayers version. In most situations, py urllib runs hands down quicker than php curl but it could well be my dodgy code!

#!/usr/bin/env python -u
 
import urllib
import urllib2
import cgi
import socket
import msvcrt
import os
import sys
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
# timeout in seconds
timeout = 15
socket.setdefaulttimeout(timeout)
 
fs = cgi.FieldStorage()
urlt = "https://www.wms.com/server/to/reflect/to?"
 
for i in fs.keys():
  urlt += i+"="+fs[i].value+"&"
url = urllib.unquote(urlt)
try:
    if url.startswith("http://") or url.startswith("https://"):
           passman = urllib2.HTTPPasswordMgrWithDefaultRealm()      # this creates a password manager
           passman.add_password(None, urlt, 'user', 'password')      # because we have put None at the start it will always use this username/password combination
           authhandler = urllib2.HTTPBasicAuthHandler(passman)                 # create the AuthHandler
           opener = urllib2.build_opener(authhandler)
           urllib2.install_opener(opener)
        y = urllib2.urlopen(url)
 
        headers = str(y.info()).split('\n')
        for h in headers:
            if h.startswith("Content-Type:"):
                print h
        print
        print y.read().replace("https://www.wms.com/server/to/reflect/to?","https://www.wms.com/server/proxy?")
        y.close()
    else:
        print """Content-Type: text/plain Illegal request."""
except Exception, E:
    print "Status: 500 Unexpected Error"
    print "Content-Type: text/plain"
    print
    print url
    print "Some unexpected error occurred. Error text was:", E