Friday, December 20, 2013

PowerBuilder User Group Germany

These are my notes from the PowerBuilder User Group meeting in Walldorf Germany on December 3, 2013, originally posted on my personal blog site.

Robyn Chan - Senior Vice President - Head of Mobile Platform
Michael Redford - PMP Business Information Technology, Products and Innovation

PowerBuilder 15
  • 32 and 64 bit support
  • OData
  • SQL 2012
  • Oracle 12
  • Windows 8
  • .Net 4.5
  • Dockable Windows

Beta builds are ready now, but access to it is still being figured out.

  • PB 15+
    • Open APIs eg objects like ORCA, IDE infrastructure/painter, build process
    • Hana XSE support for PowerScript ( XSE is their JavaScript like app server language)
    • HANA Cloud (HEC, Neo AWS) and on premise options
  • Evaluating
    • RDL (River Definition Language) support for PowerScript (intermediate layer, platform agnostic)
    • WebApp Toolkit for multi-channel development (internal name - not announced yet, web based IDE, AppDesigner, AppBuilder, the latter was developed by the PowerBuilder team to create mobile apps, SAP UI5 -- HTML5)
    • Client SDKs for NVOs - Typical PB app is 30% business logic in the client.  The audience thought it was a lot higher.

PowerBuilder.Net versus PowerBuilder Client
  • Looking at trying to get into one IDE

Plan to support JavaScript in IDE
  • Yes, that was what support for XSE was intended to convey

EAServer - what happened to NetWeaver integration
  • Couldn't put on slide - Looking at migrating PASP to Netweaver - probably wouldn't focus on other app servers

What about support contracts
  • That's one of the big questions they're working on.   The other is that existing SAP customers have an S-user account.  They're trying to figure out how to automatically give people S-user accounts so they can access the beta without going through the S-user creation process.

More on the state of HTML5 development

Specifically with regard to mobile applications.  It's beginning to look like HTML5 may work well for desktop web, but native is more appropriate for mobile devices.
"The promise of HTML5 is you write once, run everywhere and this is not happening because of the divergence of browser features." HTML5 does not offer the performance and access to native features that a native app can.
"We're going to see HTML5 relegated to just a small portion of apps," including forms, content consumption and customer acquisition apps, said King. Native will be for everything else, 

Friday, December 06, 2013

More from the PowerBuilder User Group Germany

Here's a rather poor video of the discussion about SAP's commitment to PowerBuilder:



SAP recorded their own video using much better video and audio recording equipment than I used.  Hopefully they'll post it online somewhere as well later.

Also, on Wednesday during the workshop there was a short demonstration of PowerBuilder 15.  I've included screenshots of the new Classic (which will likely be renamed to Native):


And PowerBuilder.Net


Finally, here's a shot of the attendees on the first day, quite a packed house.



Thursday, December 05, 2013

More good news, PowerBuilder 12.5 and 15 are now showing up in the SAP downloads area

Looks like a work in progress.  But it's another sign that PowerBuilder is about to become an officially recognized product.  Thanks to Christoph Meken for passing along the info.

Also note the link for PowerBuilder 15!

Tuesday, December 03, 2013

PowerBuilder User Group Germany

Robyn Chan - Senior Vice President - Head of Mobile Platform
Michael Redford - PMP Business Information Technology, Products and Innovation

PowerBuilder 15
  • 32 and 64 bit support
  • OData
  • SQL 2012
  • Oracle 12
  • Windows 8
  • .Net 4.5
  • Dockable Windows
Beta builds are ready now, but access to it is still being figured out.
  • PB 15+
    • Open APIs eg objects like ORCA, IDE infrastructure/painter, build process
    • Hana XSE support for PowerScript ( XSE is their JavaScript like app server language)
    • HANA Cloud (HEC, Neo AWS) and on premise options
  • Evaluating
    • RDL (River Definition Language) support for PowerScript (intermediate layer, platform agnostic)
    • WebApp Toolkit for multi-channel development (internal name - not announced yet, web based IDE, AppDesigner, AppBuilder, the latter was developed by the PowerBuilder team to create mobile apps, SAP UI5 -- HTML5)
    • Client SDKs for NVOs - Typical PB app is 30% business logic in the client.  The audience thought it was a lot higher.
PowerBuilder.Net versus PowerBuilder Client
  • Looking at trying to get into one IDE
Plan to support JavaScript in IDE
  • Yes, that was what support for XSE was intended to convey
EAServer - what happened to NetWeaver integration
  • Couldn't put on slide - Looking at migrating PASP to Netweaver - probably wouldn't focus on other app servers
What about support contracts
  • That's one of the big questions they're working on.   The other is that existing SAP customers have an S-user account.  They're trying to figure out how to automatically give people S-user accounts so they can access the beta without going through the S-user creation process.


Friday, November 22, 2013

Haiti Missions Trip 2013

Friday, November 1st

Our flight doesn't leave until 9:30 PM or so, so we figure we'll leave at about 4:30 PM, giving us more than enough time to get to LAX by 6:30 PM, the 3 hour before flight time that American Airlines wants us there.  Of course, about 9AM we start hearing about the shooting at LAX.  For a while the airport is closed.  The airport opens a few hours later, but all of the roads leading into it are still closed.  People landing at LAX have to walk a couple of miles outside of the facility to get picked up, and people coming in have to walk in from several miles out.

That afternoon we leave for LAX assuming that we may have to walk in.  I'm monitoring traffic on Google Maps as we go, and shortly before we get to the airport they open up the entrance to LAX via Century Blvd, but Nash remains closed.  So we cut over to Century Blvd and start the crawl into LAX.  We actually do manage to make it in by 6:30, and out flight leave as scheduled.

I hadn't entered my Global Entry/Trusted Traveler information into the American Airlines site yet, so my boarding pass didn't print out with TSA-Pre on it.  Which turned out to be a good thing.  Luis' did, and so he got sent over to the TSA-Pre line, which was actually longer than the regular line.  Mark and I had to wait for him.

Saturday, November 2nd

Arrive Miami at 5:30 AM and catch our flight to Haiti at 7:30 AM, arriving in Haiti at 9:30 AM.  Usual mob at the airport wanting to help us with our luggage.  As in past trips, I ignored them and proceeded to the vehicle waiting for us.  However, this time one of the people managed to rip one of my bags out of my hands when I was about half way there.  Did tip him $5 as it was the smallest thing I had, which is roughly the minimum wage for an entire 8 hour day in Haiti.

We get a tour of the Blanchard facility.  A playground has been put in.  They had to show the children at the school there how to use it, as they'd never seen playground equipment before.

They also showed us the kitchen, where they are converting the stoves over to run on natural gas.  Up to this point, all the cooking has been done over charcoal.



Good news for teams staying at the Blanchard compound, they've screened in the dining area.


They also had a van donated to them, which has A/C in all but the last set of seats.  I actually didn't like riding in it.  I like the open tap-taps where I can interact with people in the streets.  Makes you feel a part of what is going on.  Sitting in an air conditioned van with tinted windows makes me feel cut off from the people.


In the afternoon the other team arrived from North Carolina.  We visited the downtown area, including a museum of Haitian history, but no photographs were allowed there.  The national palace had been torn down by the time I visited last year.  The national cathedral has been sealed off so you can't get inside of it anymore.



Sunday, November 3rd

We decided to attend a portion of each of the services at the three facilities:  Blanchard, Citi Solie and Repatriot, starting with the Blanchard facility at 5:30 AM.  Despite the early hour (or because of it) the service was packed.  It was packed at all three facilities.  In particular at Repatriot, where the service we attended was the first service held in the reconstructed sanctuary.  Until that morning, the church had been meeting in a tent since the earthquake destroyed their old sanctuary.


There were so many people there that they had to bring in desks from the school and put them in the back of the church so that we could have a place to sit.

Lots of progress at the Repatriot site.  They have a soccer field now.  The goal posts weren't up yet, as the field wasn't being dedicated until the week after we left.


Like Blanchard, they've also had a playground installed.


And they've completed the construction of the second of the three interconnected school buildings and have it in use (you see both of them here).


Next stop is Mirebalais, which is in the mountains about 60 miles Northwest of Port-au-Prince.



The main thing we're going there to see is a teaching hospital, but first we make a bit of a side detour to a waterfall just past town.


After that, back to the hospital.



Monday, November 4th

First day on the job site.  We're building a house for one of the deacons of the Repatriot church.  



Tuesday, November 5th

On the way out to the job site we stop by the high school that Haiti Outreach Ministries is building.  More signs of progress in that the road in front of the school, which to date has always been a dirt road (although it's a major street) with ditches on each side is now having storm sewers installed on each side after which the road will be paved.  At the site for the high school they have the perimeter fence installed (always the first thing to eliminate squatters) and have started work on the first building.





Then it's on to the job site.


It's been raining every evening so far (and continued to for the remainder of the trip).  However, this was the first (and only) day we got rain while we were at the job site.  At one point during the downpour Mark decided to go join a group of boys who had started up a soccer game in a nearby field.


Wednesday, November 6th

Perhaps the soccer game in the middle of a rain storm wasn't such a good idea, because Mark is sick now and spends the day at the compound resting.  We believe it's actually something he picked up from a fellow passenger on the flight down.  We did manage to find some cough and cold medicine in clinic at the Blanchard facility for him.

Our first stop on our way out to the job site is an orphanage that HOM runs.  Right now they have 11 girls at the facility.  They have one building up so far and are planning a second.  At one point they were thinking of having boys in the first building as well, but then decided to wait for the second building.   At some point later, they realized it would probably be a better idea to have the boys at a separate facility.



Note that although it's called an "orphanage", the children have at least one parent that HOM knows of and a birth certificate.  It's not that the children don't have parents, but that the parent(s) have surrendered the children because they can't properly care for them.  So they are raised in the orphanage, but the parent(s) are allowed, in fact encouraged, to visit their children.  A number of parents don't though.



We also stop off at the Repatriot facility to show it to those who haven't seen it yet.


We're also there to visit one of my sponsored children.  When I first sponsored them they were both attending school at the Citi Solie facility.  However, they both moved to the school at the Repatriot facility since then.  At this point, we didn't realize both were there, so I only visited with one.

Next stop was the work site.



Thursday, November 7th

Mark has rejoined the living now, and the first order of business was for him to meet his sponsored child, who attends school right there in the compound at Blanchard.




We then went to the Citi Solie facility.  The church which other team that is down here with is from sponsor two entire classrooms of children that the school here, so they got to meet their classrooms.




Then we took a tour of the clinic at Citi Solie.


Then its back to the work site.  The clip for the tactical camera I was using to film at the website broke, so I don't have any video from the job site for today.  By the end of the day, we've just about completed everything except the installation of the sheet metal roof.  The other team is returning home tomorrow morning, but Mark, Luis and I will come back to the site tomorrow to help finish that up.

Friday, November 8th

First stop off on our way to the work site is the Repatriot facility again.  They've figured out that both of my sponsored girls (sisters) are there.  So I get a chance to visit with both of them now.


Then we head off to the work site and help put on the roof.







That only takes up until noon, and there isn't that much more we can do at the site for the remainder of the day, so we head back to the Blanchard compound.  Since we are staying through Saturday, we had talked to HOM about doing some painting in the kitchen area on Saturday.  However since we've finished early we asked if we could start on Friday afternoon instead, but the kitchen was in use.  We end up taking a nap instead.  At dinner, we talk with some of the HOM staff and they suggest that on Saturday we visit the orphanage run by the Missionaries of Charity (Mother's Teresa/s outfit) for malnourished children.

Saturday, November 9th

First stop is the orphanage run by HOM.  Since Mark was sick when we originally visited it this gives him a chance to see it.


Then we head off to the Missionaries of Charity orphanage.  No photographs were allowed inside.  Like the HOM facility, there are parents who are encourage to visit.  Some do not though.   There are quite a number of kids here from infants still in cribs through older children.  I didn't make it past the infants.  If a parent doesn't come in during visiting hours to hold the child, the child won't be held all day.  So most of these kids are desperate for somebody to come in and pick them up.  I held one little girl almost the entire time we were there.


On the way back to the Blanchard compound we stop by a local hole in the wall restaurant to pick up lunch to go.


And that was pretty much the end of the trip.  We had some trouble getting back home, but that's covered in another blog post.


Monday, November 11, 2013

Flight delays on return from Haiti

We were supposed to leave Port-au-Prince at 5:15PM on 11/9 and catch a 9:05 PM flight in Miami back to LAX getting in at just before midnight.

The plane that we were supposed to be taking out of Haiti arrived late, and we ended up missing our connection in Miami as we didn't arrive until 8:15.  That's touch down, it takes a while to the terminal and then get through customs.  I have Global Entry, so I largely skipped the customs part.  But the airline had switched the luggage tags on mine and Mark's luggage and I had everybody's luggage tags on me, so I ended up waiting for him and Luis anyway at baggage claim.

AA put us up in a hotel for the night and we headed back to the airport at 6AM for a flight that was supposed to leave at 8:25 AM and arrive in LAX at 10:52AM.  However, there were mechnical issues with the plane and at 9AM they switched us to a different plane that was supposed to leave at 10AM and arrive at LAX at 12:30PM.  That aircraft had maintenance issues as well though, and they didn't get those corrected until 12PM.  We eventuall arrived in LAX at 2:30 PM.

I had signed up for notifications in departure and arrival times via text message, and you can follow along with those below.  The message time is recorded in PDT, so you have to add 3 hours to get the time that I was getting the notice in Miami.  It gets interesting starting about 4:55 AM ( 7:55 AM Miami time ) on the 10th.

2013-11-09 12:50:23 FLYAA Info AA0201 Departs PAP 6:31P Gate 2 Arrives MIA 8:41P Gate D44 Bag Claim CE WiFi avail onboard
2013-11-09 13:44:16 FLYAA Info AA0201 Departs PAP 6:26P Gate 2 Arrives MIA 8:36P Gate D44 Bag Claim CE WiFi avail onboard
2013-11-09 13:45:03 FLYAA Info AA0201 Departs PAP 6:26P Gate 2 Arrives MIA 8:36P Gate D44 Bag Claim CE WiFi avail onboard
2013-11-09 15:03:41 FLYAA Info AA0201 Departs PAP 6:10P Gate 1 Arrives MIA 8:14P Gate D44 Bag Claim CE WiFi avail onboard
2013-11-09 15:55:03 FLYAA Info Delayed Arrival AA0201 Departed PAP 6:16P Gate 1 Arriving MIA 8:18P Gate D44 Bag Claim CE
2013-11-09 16:10:04 FLYAA Info Delayed Arrival AA0201 Departed PAP 6:16P Gate 1 Arriving MIA 8:09P Gate D44 Bag Claim CE
2013-11-09 16:39:35 FLYAA Info Delayed Arrival AA0201 Departed PAP 6:16P Gate 1 Arriving MIA 8:19P Gate D44 Bag Claim CE
2013-11-09 16:45:49 FLYAA Info Delayed Arrival AA0201 Departed PAP 6:16P Gate 1 Arriving MIA 8:14P Gate D44 Bag Claim CE
2013-11-10 04:55:05 FLYAA Info AA0295 ON TIME Departs MIA 8:25A Gate D23 Arrives LAX 10:52A Gate 43X Bag 4 Reply HELP for Help
2013-11-10 05:08:43 FLYAA Info AA0295 Departs MIA 8:45A Gate D23 Arrives LAX 11:12A Gate 43X Bag Claim 4
2013-11-10 05:43:19 FLYAA Info AA0295 Departs MIA 9:00A Gate D23 Arrives LAX 11:27A Gate 43X Bag Claim 4
2013-11-10 05:47:51 FLYAA Info AA0295 Departs MIA 10:00A Gate D28A Arrives LAX 12:28P Gate 43X Bag Claim 4
2013-11-10 06:47:59 FLYAA Info AA0295 Departs MIA 10:30A Gate D28A Arrives LAX 12:58P Gate 43X Bag Claim 4
2013-11-10 06:59:19 FLYAA Info AA0295 Departs MIA 10:30A Gate D28A Arrives LAX 12:58P Gate 41 Bag Claim 4
2013-11-10 07:02:45 FLYAA Info AA0295 Departs MIA 10:30A Gate D28A Arrives LAX 12:58P Gate 43X Bag Claim 4
2013-11-10 07:20:55 FLYAA Info AA0295 Departs MIA 10:30A Gate D28A Arrives LAX 12:58P Gate 41 Bag Claim 4
2013-11-10 07:35:04 FLYAA Info AA0295 Departs MIA 10:45A Gate D28A Arrives LAX 1:13P Gate 41 Bag Claim 4
2013-11-10 07:49:49 FLYAA Info AA0295 Departs MIA 11:15A Gate D28A Arrives LAX 1:43P Gate 41 Bag Claim 4
2013-11-10 08:07:58 FLYAA Info AA0295 Departs MIA 11:30A Gate D28A Arrives LAX 1:58P Gate 41 Bag Claim 4
2013-11-10 08:30:43 FLYAA Info AA0295 Departs MIA 11:45A Gate D28A Arrives LAX 2:13P Gate 41 Bag Claim 4
2013-11-10 08:33:32 FLYAA Info AA0295 Departs MIA 11:55A Gate D28A Arrives LAX 2:23P Gate 41 Bag Claim 4
2013-11-10 08:49:57 FLYAA Info AA0295 Departs MIA 11:55A Gate D28A Arrives LAX 2:23P Gate 43X Bag Claim 4
2013-11-10 09:03:00 FLYAA Info AA0295 Departs MIA 12:10P Gate D28A Arrives LAX 2:38P Gate 43X Bag Claim 4
2013-11-10 09:19:27 FLYAA Info Delayed Arrival AA0295 Departed MIA 12:04P Gate D28A Arriving LAX 2:23P Gate 43X Bag Claim 4
2013-11-10 10:20:06 FLYAA Info Delayed Arrival AA0295 Departed MIA 12:04P Gate D28A Arriving LAX 2:25P Gate 43X Bag Claim 4
2013-11-10 13:41:03 FLYAA Info Delayed Arrival AA0295 Departed MIA 12:04P Gate D28A Arriving LAX 2:24P Gate 43X Bag Claim 4
2013-11-10 13:54:35 FLYAA Info Delayed Arrival AA0295 Departed MIA 12:04P Gate D28A Arriving LAX 2:29P Gate 43X Bag Claim 4


Tuesday, October 08, 2013

Well, I got one thing right anyway...

I commented in a PBDJ article a while back that:
That's when I had an epiphany. Windows 8 might actually make sense. It runs on both ARM and x86 processors. It has desktop and Metro (mobile) modes. It includes virtualization. Perhaps Microsoft is thinking ahead to a time when we don't need an operating system that can deploy to different devices, but an operating system that can deploy to a single device that has a number of different form factors.
Microsoft recently confirmed that is something that they are trying to accomplish.  Not specifically with Windows 8, but Windows 8 does seem to be a step in that direction.

Monday, October 07, 2013

A petition update and a new petition....

It's two weeks until SAP TechEd Las Vegas, and we've ready 1,891 signatures on the petition for SAP to take some action with regard to PowerBuilder.  That means we need 109 more to reach our goal by the beginning of TechEd.

Meanwhile, a number of people have expressed some concerns with one or both features of the current petition:

1.  That causes.com seems to require a Facebook account in order to sign the petition, and people don't want to create a Facebook account or link their existing one with the petition.

2.  That some of the proposed actions (i.e., sell the product or release it to open source) were more extreme than they felt comfortable signing onto.  Instead, they just wanted to urge SAP to proceed with the release of PowerBuilder 15 that everybody has been waiting for.

As a result of that feedback, I've created a second petition on change.org, one that does not require a Facebook account and which only urges the release of PowerBuilder 15.  I've also received translations of the text of the petition in German, Spanish and Japanese.  There is also a Hebrew translation in the works, but for now I've included a Google Translation generated version.  I'll replace that with the human generated version as soon as it's available.

You can access the new petition at change.org.  Please pass it along to those you know who haven't signed the first petition for some reason.

Saturday, September 14, 2013

No news is NOT good news....

Great post from Displaced Guy on the status, or lack thereof, of PB15.    A few items worth calling to attention and commenting on.

"I REALLY feel bad for Sue Dunnell, Bruce Armstrong and others at SAP who have an genuine interest in PowerBuilder and are class-act individuals but SAP is playing them like a violin like they are to us.  My displeasure with SAP is in no way directed towards any employee of SAP other than those who are responsible for the decisions at a very high level."

Perhaps it's just me, put the first sentence in this quote could imply that I work for SAP.  It references Sue Dunnel (who works for SAP), myself and "others at SAP".  They may be playing me like a violin, but I don't work for SAP.

"The reality is that to this day there really isn’t a perfect replacement for PowerBuilder and it is too bad that SAP doesn’t see this.  Moving a large complex PB application to any of the competing technologies is no trivial task and has proven to be extremely difficult and expensive with many failures (projects canned because they made no progress) when going to both .NET and Java.  The remaining legacy PB applications would cost millions to redevelop. There are some really huge, robust and mission critical legacy PB applications in the corporate world, one that comes to mind was developed by Perot Systems many years ago and is still used by many health care companies.  It would take years to redevelop at a cost in the millions.  The amount of time needed to redevelop in something like .NET would be much longer than the original application took.  Why are legacy PB applications so difficult to redevelop. One obvious answer is the datawindow or lack of a datawindow replacement which is what made PB one of the most capable tools for developing business applications."

Great points, the real crux of the problem, and the best summary of the situation I've seen to date.

"We are set to surpass rates of $100/hr (to the developer) as early as 2014 at the current pace, for a senior developer."


Well, they say ever cloud has a silver lining.  When I'm wearing my "somebody that has to find and hire PowerBuilder developers" hat this would be bad news.  But when I'm wearing my own "PowerBuilder developer" hat, it sounds pretty good to me.  ;-)


Monday, August 26, 2013

Update on the petition to SAP regarding #PowerBuilder

The petition for SAP to do something positive with regard to PowerBuilder is doing well.   We've just passed 1,500 signatures, which was the latest goal.  I've revised the goal to 2,000 signatures and changed the goal deadline to October 21st.  That's the first day of SAP TechEd in Las Vegas.  It is our intent to meet with SAP management at that event and provide them with the signed petition as well as additional information we believe may be able to convince SAP to take more interest in the product.

If you are a PowerBuilder developer and you haven't signed the petition yet, please do so and pass the information along to other PowerBuilder developers you may know that may not know about it.  You do not need a Facebook account to sign the petition.  Instead, you can create a causes.com account directly at:   https://www.causes.com/signup

Saturday, August 24, 2013

Using the Google Geocoding API from PowerBuilder.Net

I'm running a petition on causes.com, and I wanted to do some geographic analysis of the results.  Causes.com gives me information about the signers with regard to their name, email address, country and zip code.  The country information was useful for doing the first phase of the analysis, which I wrote about in the Lumira space.  However, I wanted to do a bit more fine grained analysis, and that means I needed to convert that zip code information into something more directly useful (e.g., city, county and state for the United States).  There's 1500 data points though, so I need an automated method.  Google Geogoding API to the rescue.

The Google Geocoding API is a REST services, so I created a REST client in PowerBuilder.Net using the following URL:


  1. http://maps.google.com/maps/api/geocode/xml?components=country:USA|postal_code:{zip}&sensor=false  


Where {zip} represents the zip code that I'll be passing in as an argument.  Most REST services don't have a WSDL you can use to create client data types from.  For the PowerBuilder.Net REST client perhaps the simplest way to get it to be able to determine what data types to create is to provide it with a sample response from the service.  What I provided was the following:

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <GeocodeResponse>  
  3.  <status>OK</status>  
  4.  <result>  
  5.   <type>postal_code</type>  
  6.   <formatted_address>Azusa, CA 91702, USA</formatted_address>  
  7.   <address_component>  
  8.    <long_name>91702</long_name>  
  9.    <short_name>91702</short_name>  
  10.    <type>postal_code</type>  
  11.   </address_component>  
  12.   <address_component>  
  13.    <long_name>Azusa</long_name>  
  14.    <short_name>Azusa</short_name>  
  15.    <type>locality</type>  
  16.    <type>political</type>  
  17.   </address_component>  
  18.   <address_component>  
  19.    <long_name>Los Angeles</long_name>  
  20.    <short_name>Los Angeles</short_name>  
  21.    <type>administrative_area_level_2</type>  
  22.    <type>political</type>  
  23.   </address_component>  
  24.   <address_component>  
  25.    <long_name>California</long_name>  
  26.    <short_name>CA</short_name>  
  27.    <type>administrative_area_level_1</type>  
  28.    <type>political</type>  
  29.   </address_component>  
  30.   <address_component>  
  31.    <long_name>United States</long_name>  
  32.    <short_name>US</short_name>  
  33.    <type>country</type>  
  34.    <type>political</type>  
  35.   </address_component>  
  36.   <geometry>  
  37.    <location>  
  38.     <lat>34.2667473</lat>  
  39.     <lng>-117.8545867</lng>  
  40.    </location>  
  41.    <location_type>APPROXIMATE</location_type>  
  42.    <viewport>  
  43.     <southwest>  
  44.      <lat>34.1031590</lat>  
  45.      <lng>-118.0513950</lng>  
  46.     </southwest>  
  47.     <northeast>  
  48.      <lat>34.3791980</lat>  
  49.      <lng>-117.6556881</lng>  
  50.     </northeast>  
  51.    </viewport>  
  52.    <bounds>  
  53.     <southwest>  
  54.      <lat>34.1031590</lat>  
  55.      <lng>-118.0513950</lng>  
  56.     </southwest>  
  57.     <northeast>  
  58.      <lat>34.3791980</lat>  
  59.      <lng>-117.6556881</lng>  
  60.     </northeast>  
  61.    </bounds>  
  62.   </geometry>  
  63.  </result>  
  64. </GeocodeResponse>  

Note that the information I want comes in the "administrative_area_level_1" (State), "administrative_area_level_2" (County) and "locality" (City) address component types.  I'm also going to grab the approximate lattitude and longitude coordinates from the geometry portion of the response.

With the REST proxy created, I create a WPF application that has a datawindow that reads the CSV data that causes.com gives me and then loops through it adding the information from the Google Geocoding API.  The main code of interest is as follows.

  1. long     ll_index, ll_count  
  2. string     ls_zip, ls_lat, ls_long, ls_country, ls_county, ls_city, ls_state  
  3. googlegeo_proxy     proxy  
  4. GeocodeResponse response  
  5.  ll_count = dw_1.RowCount()  
  6.  proxy = create googlegeo_proxy  
  7.  FOR ll_index = 1 to ll_count  
  8.      ls_country = dw_1.Object.country[ll_index]  
  9.      if ls_country <> "United States" THEN CONTINUE  
  10.      ls_zip = dw_1.Object.zip[ll_index]  
  11.      if Len ( ls_zip ) = 4 then  
  12.           ls_zip = '0' + ls_zip  
  13.      end if  
  14.      response = proxy.GetMessage ( ls_zip )  
  15.      if response.status = "OK" then  
  16.           ls_lat = String ( response.result.geometry.location.lat )  
  17.           ls_long = string ( response.result.geometry.location.lng )  
  18.            System.Collections.IEnumerator enum   
  19.           enum = response.result.address_component.GetEnumerator()  
  20.           GeocodeResponseResultAddress_component address  
  21.           do while enum.MoveNext()  
  22.                address = enum.Current  
  23.                Choose CASE address.@type[1]   
  24.                     CASE "administrative_area_level_1"  
  25.                          ls_state = address.long_name  
  26.                     CASE "administrative_area_level_2"  
  27.                          ls_county = address.long_name  
  28.                     CASE "administrative_area_level_3"  
  29.                          ls_city = address.long_name  
  30.                     CASE "locality"  
  31.                          ls_city = address.long_name  
  32.                END choose  
  33.           loop  
  34.           dw_1.Object.lattitude[ll_index] = ls_lat  
  35.           dw_1.Object.longitude[ll_index] = ls_long  
  36.           dw_1.Object.state[ll_index] = ls_state  
  37.           dw_1.Object.county[ll_index] = ls_county  
  38.           dw_1.Object.city[ll_index] = ls_city  
  39.      else  
  40.           dw_1.Object.lattitude[ll_index] = response.status  
  41.      end if  
  42.      // Wait 2 seconds or Google will put us into OVER_QUERY_LIMIT condition  
  43.      Sleep ( 2 )  
  44. NEXT  

The zip codes were imported as numbers, so I'm prefixing them with 0 of they are only four digits long.  I'm using an enum to loop through the address_components because PowerBuilder.Net doesn't offer a particularly easy way of requesting a specific element in the collection.  And referencing address.@type[1] is a bit of a hack, as there are a number of type attributes returned and I'm assuming the one I want is always the first one.  That code will break if they don't always come back in the order I expect.

The last thing you might note is that I do a Sleep(2) between calls to the API.  Google places some restrictions on calls to their APIs to prevent abuse, often in terms of total number of calls or calls per day.  In the case of the Geocoding API, the restriction is that you can't call it more often than once every 2 seconds.  The Sleep makes sure that I don't exceed that limit and start getting overy query limit error response.

And here's the results on a state by state basis for the United States.

petitionsignersbystate.png

Unfortuantely, Lumira was unable to recognize enough of the city and county names that Google provided that it make trying to do the analysis on any finer detail rather difficult.