<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Different Projection</title>
	<atom:link href="http://www.mercatorgeosystems.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.mercatorgeosystems.com/blog</link>
	<description>The Mercator GeoSystems Blog</description>
	<lastBuildDate>Wed, 04 Apr 2012 11:32:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing PostGIS with built-in Postgresql in Mac OS X Lion Server 10.7.3</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=108</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=108#comments</comments>
		<pubDate>Wed, 04 Apr 2012 10:59:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[PostGIS]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=108</guid>
		<description><![CDATA[We recently upgraded our Snow Leopard Mac OS X server to OS X Lion Server, 10.7.3 and were pleased to find that it comes with a version of PostgreSQL (9.0.5) built-in.  We're all for having good stuff built-in so we now just had the task of adding PostGIS to it and we'd be set.  However [...]]]></description>
			<content:encoded><![CDATA[<p>We recently upgraded our Snow Leopard Mac OS X server to OS X Lion Server, 10.7.3 and were pleased to find that it comes with a version of PostgreSQL (9.0.5) built-in.  We're all for having good stuff built-in so we now just had the task of adding PostGIS to it and we'd be set.  However this isn't quite as simple as it could be, but luckily isn't too hard and doesn't require any tinkering with Apple or PG 'makefiles' or other scripts, just the judicious use of a few compiler parameters.</p>
<p>The three main problems that need to be overcome are that a) GEOS won't compile with gcc on OS X and needs the 'clang' compiler instead, and b) PostgreSQL expects all extensions to be dual-architecture (i.e i386 and x86_64) which by default PostGIS (and dependencies) don't get built as and finally c) using the correct bundle loader when linking PostgGIS.</p>
<p>Typically the error manifests itself when building PostGIS as :</p>
<pre>ld: warning: ignoring file /usr/bin/postgres, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_CurrentMemoryContext", referenced from:</pre>
<p>So, firstly download the source for these projects :</p>
<p><a href="http://download.osgeo.org/proj/proj-4.8.0.tar.gz" target="_blank">PROJ-4.8.0</a></p>
<p><a href="http://download.osgeo.org/geos/geos-3.3.3.tar.bz2" target="_blank">GEOS-3.3.3</a></p>
<p>and of course PostGIS</p>
<p><a href="http://postgis.refractions.net/download/postgis-1.5.3.tar.gz" target="_blank">PostGIS 1.5.3</a></p>
<p>Uncompress the three archives to separate folders, proj-4.8.0, geos-3.3.3 and postgis-1.5.3.</p>
<p>Now, follow these steps to build the PROJ4 library:</p>
<pre>cd proj-4.8.0
./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ "CFLAGS=-arch x86_64 -arch i386" "LDFLAGS=-arch x86_64 -arch i386" "CXXFLAGS=-arch x86_64 -arch i386"
make
sudo make install
cd..</pre>
<div>Next it's GEOS :</div>
<pre>cd geos-3.3.3
./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ "CFLAGS=-arch x86_64 -arch i386" "LDFLAGS=-arch x86_64 -arch i386" "CXXFLAGS=-arch x86_64 -arch i386"
make
sudo make install
cd ..</pre>
<p>Then PostGIS itself:</p>
<pre>cd postgis-1.5.3
./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ "CFLAGS=-arch x86_64 -arch i386" "LDFLAGS=-arch x86_64 -arch i386" "CXXFLAGS=-arch x86_64 -arch i386"
make "BE_DLLLIBS=-bundle_loader /usr/bin/postgres_real"</pre>
<p>Note the parameters to 'make'.  By default the link phase uses '/usr/bin/postgres' as the bundle-loader executable however this doesn't work as Apple have craftily swapped it for a Ruby script and the 'real' Postgres binary is called postgres_real so we need to build against that instead.</p>
<p>At this point (after a few warnings) you should see :</p>
<pre>PostGIS was built successfully. Ready to install.</pre>
<p>so execute :</p>
<pre>sudo make install</pre>
<p>At this point it's all standard PostGIS installation however for the sake of completeness here are the next steps :<br />
Add plpgsql to your chosen database (prd in our case) :</p>
<pre>$ createlang -U _postgres plpgsql prd</pre>
<p>Create the functions, tables and spatial reference data:</p>
<pre>$ cd /usr/share/postgresql/contrib/postgis-1.5
$ psql -d prd -U _postgres -f postgis.sql
$ psql -d prd -U _postgres -f spatial_ref_sys.sql</pre>
<p>(note the use of _postgres as opposed to postgres).</p>
<pre>$ psql -d prd -U _postgres
psql (9.0.5)
Type "help" for help.
prd=# select postgis_full_version();
postgis_full_version
--------------------------------------------------------------------------------------------------
POSTGIS="1.5.3" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.3" USE_STATS
(1 row)
prd=#</pre>
<p>That's it!  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=108</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First impressions of some new features in iOS5</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=97</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=97#comments</comments>
		<pubDate>Thu, 09 Jun 2011 21:47:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=97</guid>
		<description><![CDATA[With the announcement this week of a whole slew of new stuff coming from Cupertino over the next few months there's been a lot to digest for those with an interest in Apple technologies.
Luckily iOS (and Mac OS) developers can get beta copies of the new operating systems early so we've upgraded an iPhone 4 [...]]]></description>
			<content:encoded><![CDATA[<p>With the <a href="http://www.apple.com/apple-events/wwdc-2011/" target="_blank">announcement this week</a> of a whole slew of new stuff coming from Cupertino over the next few months there's been a lot to digest for those with an interest in Apple technologies.</p>
<p>Luckily iOS (and Mac OS) developers can get beta copies of the new operating systems early so we've upgraded an iPhone 4 and iPad (1) to <a href="http://www.apple.com/ios/ios5/" target="_blank">iOS5</a> to take a look at the new features (and to check that our "<a href="http://www.where-its-at.co.uk" target="_blank">Where It's At</a>" app works on the new release too) and this is what we've found in the first 24 hours, in no particular order.</p>
<p>Apologies for the lack of pictures, technically use of iOS5 is under an Apple NDA and I'm not sure I am allowed to post images.</p>
<p><strong><span style="text-decoration: underline;">Twitter integration.</span></strong></p>
<p>Twitter seem to be Apple's new best friend in this release (as Google was back in the days of early iPhone OS releases) and the <a href="http://www.apple.com/ios/ios5/features.html#twitter" target="_blank">service has been integrated</a> into several parts of the OS, namely Safari, Photos and Maps where whatever you happen to be doing with them (looking at a web page, photo or map location) can be tweeted directly with no need for any third party apps.  Your Twitter user name and password are configured in the Settings app (multiple accounts can be setup) and you're then good to go.  There are a couple of peculiar things though; firstly there seems to be no direct way to send a simple text-only tweet.  I would have though adding 'Twitter' or 'Tweet' to Messages would have been a good location for this but I can't seem to find any way of doing this.  Secondly you rather strangely have the option to directly install the official Twitter app from the Settings App. Presumably this is to cover all the other stuff that Twitter does (and one imagines also the way that simple text-based tweets are sent) but it does seem a bit peculiar.</p>
<p><span style="text-decoration: underline;"><strong>Notifications / Lock screen</strong></span></p>
<p>Borrowed directly from Android the new 'swipe down' <a href="http://www.apple.com/ios/ios5/features.html#notification" target="_blank">notifications area</a> is much better than the, now rather crude looking, alert based system in iOS4.  Upon a down swipe recent 'events' such as missed calls, new emails, text messages and calendar events are displayed along with the local weather (all in a pretty small font!) in a well laid out view.  Individual items can be removed, and the whole thing is highly configurable.  A similar looking display is used on the Lock Screen and presents a very handy summary of stuff you've missed since the device was locked.  Individual items can be swiped left-to-right to go directly to them as opposed to having to find them later.  This is really nice and for my money actually better implemented than Android.  Apple may not always be first to do something but they're often (although not always) best.  I hope Google don't have a patent on "user swiping down to display a list of notifications"!</p>
<p>One final thing, a welcome addition to the Lock Screen is the ability to go straight to the Camera app.  Press the Home button twice (as per showing the iPod controls) and a small Camera icon appears and takes you directly to it.  The Volume Up button even works as the shutter to make it feel more like a 'proper' camera!</p>
<p><span style="text-decoration: underline;"><strong>Reminders</strong></span></p>
<p><a href="http://www.apple.com/ios/ios5/features.html#reminders" target="_blank">This is a new 'built in' App</a> that aims to expand upon Notes (which is still there and appears largely unchanged) and integrate with Calendars in order to provide a more useful 'todo' list.  It definitely has the impression of 'Version 1' software but has a nice touch in that reminders can be based on a location.  Apple's example is that you can set up a reminder to get milk when you're near the store.  This is pretty much how it works as you setup a reminder based on an address in your Contacts list and stipulate wether or not its when you arrive or leave the location.  It seems to work pretty well but you obviously need the address of the location in question.  Going back to Apple's example, who has the address of their local Tesco's in their phone?  This leads me to the two deficiencies in the current product as I see it.  Firstly you should be able to set the location for the reminder based on an arbitrary location (i.e a dropped pin on a map) or a manually entered postal code to make this really useful.  Secondly it seems like iOS considers you to 'be there' when you're within about 500 yds of the location (although this is based on an un-scientific test of walking to my kids school and back!). For some situations this is fine, but for others it'd be good to tighten this up a bit.  For example if I want to set a reminder to 'Lock the door' when I leave my home address I'd rather it did it sooner than later!</p>
<p><span style="text-decoration: underline;"><strong>iCloud</strong></span></p>
<p>This much-talked about <a href="http://www.apple.com/icloud/" target="_blank">new service aimed at replacing MobileMe</a> and adding a whole load of new stuff besides certainly looks promising. Personally I never had that much of a problem with MobileMe.  It did what I wanted it to, namely syncing Contacts, Bookmarks and Calendars (although iDisk was slooooow) so I'm a little surprised it's being so dramatically culled.   Anyway, it's not all in Beta yet so I'm a little unsure as to what is supposed to be working and what isn't however I couldn't get App syncing to work (where you buy an App on one device and it magically appears on another that you own) nor could I get Pages and Numbers to store documents in it which I thought Steve Jobs said was ready now.  Anyway.... that can wait, the real kicker for me is that all this goodness is tied in to your Apple ID, so when you use the same ID across devices (Macs, PCs, iPhones, iPads etc) then they all stay in sync with what you've purchased, be that music, apps or books, along with any documents you're working on also.  However I can't believe I'm the only person that has multiple Apple IDs; I use one for work which has a work credit card attached for business-related purchases, and a personal account that I use for music and games etc.  In addition to this I have my MobileMe account which I use for sync services (as above) and personal email.  This all works fine at the moment and causes no problems whatsoever, however when I switch to iOS5 I'm a little concerned about what is going to happen.  In particular the Store setting which allows you to change your Apple ID warns you that you can only change it once every 90 days is not a good sign.  Given that there is no way to merge Apple IDs this could be a problem.</p>
<p><strong><span style="text-decoration: underline;">One more thing (well, two)....</span></strong></p>
<p>A small thing, but the Weather app now has hour-by-hour as part of the next 24 hours which is a nice touch, simply swipe down or tap the 'Hourly' text.</p>
<p>And finally the whole concept of <a href="http://www.apple.com/ios/ios5/features.html#pcfree" target="_blank">PC-less setup </a>is going to be well received I'm sure, if it's not a year or two late!  Particularly for the iPad which really can be a device in it's own right it makes no sense to require a PC or Mac just to get it working.</p>
<p>All in all the upgrade looks like a good one and the iPhone has certainly got a new lease of life and seems very stable even though the software is still in Beta.  The iPad has crashed a few times however.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to crop large polygons in QGis</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=91</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=91#comments</comments>
		<pubDate>Mon, 07 Mar 2011 14:25:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[polygon]]></category>
		<category><![CDATA[qgis]]></category>
		<category><![CDATA[shape file]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=91</guid>
		<description><![CDATA[

1. The Goal
2. Zoom in to area of interest
3. Select the polygon to be split
4. Make the layer editable
5. Use the Split Features tool
6. Bisected shape
7. Select the shape again to do more splits
8. Bisect the shape again
9. Another bisected shape
10. Save the edited layer
11. Select features to export
12. Save the new layer
13. The new [...]]]></description>
			<content:encoded><![CDATA[<div id="lesson">
<div id="steps-toc">
<li class="step-index"><a href="#step1">1. The Goal</a></li>
<li class="step-index"><a href="#step2">2. Zoom in to area of interest</a></li>
<li class="step-index"><a href="#step3">3. Select the polygon to be split</a></li>
<li class="step-index"><a href="#step4">4. Make the layer editable</a></li>
<li class="step-index"><a href="#step5">5. Use the Split Features tool</a></li>
<li class="step-index"><a href="#step6">6. Bisected shape</a></li>
<li class="step-index"><a href="#step7">7. Select the shape again to do more splits</a></li>
<li class="step-index"><a href="#step8">8. Bisect the shape again</a></li>
<li class="step-index"><a href="#step9">9. Another bisected shape</a></li>
<li class="step-index"><a href="#step10">10. Save the edited layer</a></li>
<li class="step-index"><a href="#step11">11. Select features to export</a></li>
<li class="step-index"><a href="#step12">12. Save the new layer</a></li>
<li class="step-index"><a href="#step13">13. The new layer</a></li>
</div>
<div class="step"><a name="step1"></a></p>
<h3>1. The Goal</h3>
<div class="image"><img class="step-image alignnone" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/1_The_Goal.png" alt="" width="480" height="375" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">This example is based on creating a new shape file that includes the Caribbean islands and the coastline of the Gulf of Mexico.<span> </span> As the entire North American polygon is not required we will crop it to a more appropriate size.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px">
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">Before starting the process save the original file to a new location as we will be making changes to it.</span></p>
</div>
</div>
<div class="step"><a name="step2"></a></p>
<h3>2. Zoom in to area of interest</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/2_Zoom_in_to_area_of_i.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">Add the shapefile layer and zoom in to the relevant area, leaving plenty of room to work in</span></p>
</div>
</div>
<div class="step"><a name="step3"></a></p>
<h3>3. Select the polygon to be split</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/3_Select_the_polygon_t.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">Use the select tool to select the North American land mass that is to be cropped.</span></p>
</div>
</div>
<div class="step"><a name="step4"></a></p>
<h3>4. Make the layer editable</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/4_Make_the_layer_edita.png" alt="" width="480" height="383" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">Right click on the layer in the Layers window and turn on editing.<span> </span> The layer will be surrounded by small red crosses which are the individual points that make up the shape boundary.</span></p>
</div>
</div>
<div class="step"><a name="step5"></a></p>
<h3>5. Use the Split Features tool</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/5_Use_the_Split_Featur.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">Click on the Split Features tool (the scissors and line tool selected above) and click on the start point of the line that will be used to bisect the polygon using the left mouse button.<span> </span> Then move the line to a point that bisects the polygon and press the right mouse button.<span> </span> To make this easier the start and end points can be some distance into the sea to ensure the line completely bisects the shape.</span></p>
</div>
</div>
<div class="step"><a name="step6"></a></p>
<h3>6. Bisected shape</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/6_Bisected_shape.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">The North American continent has now been split into two, with our selection now the northerly part and a new shape, as indicated by the green below.</span></p>
</div>
</div>
<div class="step"><a name="step7"></a></p>
<h3>7. Select the shape again to do more splits</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/7_Select_the_shape_aga.png" alt="" width="480" height="3" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">As we want to split the shape again (we don't need Baja California on the West coast) use the select tool to select the shape to split.</span></p>
</div>
</div>
<div class="step"><a name="step8"></a></p>
<h3>8. Bisect the shape again</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/8_Bisect_the_shape_aga.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">And bisect the shape once more to create an appropriate split.</span></p>
</div>
</div>
<div class="step"><a name="step9"></a></p>
<h3>9. Another bisected shape</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/9_Another_bisected_sha.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">And the shape is split again.</span></p>
</div>
</div>
<div class="step"><a name="step10"></a></p>
<h3>10. Save the edited layer</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/10_Save_the_edited_laye.png" alt="" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">Now turn off editing as per stop 4 above and save the layer.</span></p>
</div>
</div>
<div class="step"><a name="step11"></a></p>
<h3>11. Select features to export</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/11_Select_features_to_e.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">Now use the select tool and select the features, including our new shape, to export.<span> </span> Use the Layer -&gt; Save Selection as Shapefile option.</span></p>
</div>
</div>
<div class="step"><a name="step12"></a></p>
<h3>12. Save the new layer</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/12_Save_the_new_layer.png" alt="" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">And keep the defaults (WGS 84).</span></p>
</div>
</div>
<div class="step"><a name="step13"></a></p>
<h3>13. The new layer</h3>
<div class="image"><img class="step-image" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2011/02/13_The_new_layer.png" alt="" width="480" height="300" /></div>
<div class="step-detail">
<p style="margin: 0.0px 0.0px 0.0px 14.0px; text-indent: -14.1px"><span style="font: normal normal normal 12px/normal Helvetica; letter-spacing: 0px; font-family: Helvetica; font-size: small;">We can check the new layer by adding it to QGis and taking a look.</span></p>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=91</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Settings.bundle doesn&#8217;t appear in iPhone Settings</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=70</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=70#comments</comments>
		<pubDate>Fri, 02 Jul 2010 21:57:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[settings.bundle]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=70</guid>
		<description><![CDATA[Hi,
We were working on an iPhone app recently and added a Settings.bundle to allow the user to set their preferences as described here and here.  However whenever we ran the app either on the device or on the simulator the settings simply would not appear in the iPhone's settings.
After much digging around and many hours [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>We were working on an iPhone app recently and added a Settings.bundle to allow the user to <a href="http://developer.apple.com/iphone/library/documentation/preferencesettings/conceptual/settingsapplicationschemareference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007005-SW1">set their preferences as described here</a> and <a href="http://www.iphonesdkarticles.com/2008/08/application-preferences.html">here</a>.  However whenever we ran the app either on the device or on the simulator the settings simply would not appear in the iPhone's settings.</p>
<p>After much digging around and many hours banging heads on walls we finally tracked it down.  Settings bundles are only added to the phone <em>the first time the application is installed<strong>. </strong><span style="font-style: normal;">If you've worked on an application and deployed it to your development device or simulator before adding the settings.bundle to your XCode project then subsequent build and runs won't add the settings unless you </span>remove the app from the device or simulator in the usual way.</em> i.e by pressing and holding the app icon and removing it when it starts shaking.</p>
<p>The next time you deploy to the device or simulator the settings should be present.</p>
<p>We hope this helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=70</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle &#8216;isnumeric&#8217; function</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=64</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=64#comments</comments>
		<pubDate>Thu, 12 Nov 2009 18:51:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[pl/sql]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=64</guid>
		<description><![CDATA[Hello,
To me a simple, yet glaring, omission from the Oracle PL/SQL language, which is in many ways excellent, is a function to test to see if a string represents numeric data as can be found in many other languages (e.g is_numeric in PHP, isNumeric in Java and .Net).
A possible implementation is to simply try to [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>To me a simple, yet glaring, omission from the Oracle PL/SQL language, which is in many ways excellent, is a function to test to see if a string represents numeric data as can be found in many other languages (e.g is_numeric in PHP, isNumeric in Java and .Net).</p>
<p>A possible implementation is to simply try to assign the string to a number and catch any exceptions.  If something goes wrong then it's not a number!</p>
<pre>  create or replace function isnumeric(p_value in varchar2) return number
  as
    l_ret number;
  begin
    -- Try to cast to a number
    begin
      l_ret := to_number(p_value);
      -- if the line above worked then just reset to 1
      l_ret := 1;
    exception
      when others then
        -- Something, anything, went wrong
        l_ret := 0;
    end;
    -- Return
    return l_ret;
  end isnumeric;</pre>
<p>e.g</p>
<pre>  select isnumeric('10.1.1') from dual</pre>
<pre>  select isnumeric('10.1') from dual</pre>
<pre>  select isnumeric('-10.1') from dual</pre>
<p>We hope this helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=64</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solution to crackling and breaking up conversation on iPhone</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=57</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=57#comments</comments>
		<pubDate>Tue, 27 Oct 2009 16:29:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=57</guid>
		<description><![CDATA[Hi,
Yesterday one of our iPhones developed an intermittent fault with the call quality.  Often we could hear the other party but they couldn't hear us, or vice versa.  It didn't seem to matter who initiated the call or wether it was a mobile to landline call or mobile to mobile.
We took the following diagnostic steps [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Yesterday one of our iPhones developed an intermittent fault with the call quality.  Often we could hear the other party but they couldn't hear us, or vice versa.  It didn't seem to matter who initiated the call or wether it was a mobile to landline call or mobile to mobile.</p>
<div id="attachment_58" class="wp-caption aligncenter" style="width: 236px"><img class="size-full wp-image-58" title="iPhone" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/10/46506673_iphone3gs_3up.jpg" alt="iPhone" width="226" height="170" /><p class="wp-caption-text">iPhone 3G</p></div>
<p>We took the following diagnostic steps to try and track down the problem :</p>
<p>1) Made a sound recording with the Voice Memos app and played it back to confirm speaker / mic working.</p>
<p>2) Powered off and on again</p>
<p>3) Reset (pressed Home and Power button simultaneously for 10 seconds)</p>
<p>4) Did a <a href="http://support.apple.com/kb/HT1414">Restore</a> through iTunes.</p>
<p>All to no effect.  A quick call to O2 resulted in a couple more things to try :</p>
<p>1) Remove SIM card and give it a good clean.  It was surprising how much pocket fluff was in there!</p>
<p>2) Try the SIM card in another phone.</p>
<p>With the second option above we actually found that the other phone (a Nokia) started exhibiting the same behaviour so the problem appeared to be with the SIM, not the iPhone (phew!).</p>
<p>A quick trip to the <a href="http://www.webmap.o2.co.uk/interfaces/retail/">local O2 retail store</a> for a SIM swap (done in the store with no temporary number or delay) and we're back up and running again.</p>
<p>We hope this helps someone else.</p>
<p><strong>UPDATE : </strong>the solution may not have been that simple as the problem resurfaced a few days later.  We've just done a complete factory reset and fingers-crossed we'll be OK.  Just made a 6 minute call which was impossible this morning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=57</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Missing (red) frameworks in iPhone XCode projects after upgrade</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=43</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=43#comments</comments>
		<pubDate>Mon, 28 Sep 2009 09:26:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=43</guid>
		<description><![CDATA[Hi,
We just upgraded XCode to the latest release (3.1.4 as at time of writing) and noticed that after doing so a number of our iPhone projects now had their Frameworks all set to missing (i.e coloured in red) like this :

The solution wasn't immediately obvious but just in case anyone else was wondering what was [...]]]></description>
			<content:encoded><![CDATA[<p style="TEXT-ALIGN: left">Hi,<a href="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/theproblem.png"></a></p>
<p>We just upgraded XCode to the latest release (3.1.4 as at time of writing) and noticed that after doing so a number of our iPhone projects now had their Frameworks all set to missing (i.e coloured in red) like this :</p>
<p><a href="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/getprojectinfo.png"></a><img class="aligncenter size-full wp-image-44" title="Missing (red) frameworks" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/redframeworks.png" alt="The problem" width="260" height="349" /></p>
<p>The solution wasn't immediately obvious but just in case anyone else was wondering what was required to fix it here are the steps :</p>
<p>1) Open the settings for your project by right-clicking and choosing 'Get Info' :</p>
<p><a href="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/getprojectinfo.png"><img class="alignnone size-full wp-image-45" title="getprojectinfo" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/getprojectinfo.png" alt="" width="238" height="220" /></a></p>
<p>2) This will display this page, which will display the root of the problem in the 'Base SDK for all configuration' drop down :</p>
<p><img class="size-full wp-image-46" title="theproblem" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/theproblem.png" alt="" width="500" height="413" /></p>
<p>The problem is that the project was set to 'iPhone Device 2.2' which is no longer supplied with XCode.</p>
<p>3) To fix the problem simply change the Base SDK to whatever is appropriate for you, e.g :</p>
<p><a href="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/newsetting.png"><img class="aligncenter size-full wp-image-47" title="newsetting" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/newsetting.png" alt="" width="499" height="31" /></a></p>
<p>and voila, the problem is solved :</p>
<p><a href="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/problemsolved.png"><img class="aligncenter size-full wp-image-48" title="problemsolved" src="http://www.mercatorgeosystems.com/blog/wp-content/uploads/2009/09/problemsolved.png" alt="" width="200" height="70" /></a></p>
<p>Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=43</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Returning Oracle SQL data as XML</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=39</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=39#comments</comments>
		<pubDate>Thu, 24 Sep 2009 09:21:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlagg]]></category>
		<category><![CDATA[xmlattributes]]></category>
		<category><![CDATA[xmldb]]></category>
		<category><![CDATA[xmlelement]]></category>
		<category><![CDATA[xmlforest]]></category>
		<category><![CDATA[xmlroot]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=39</guid>
		<description><![CDATA[Hi
An earlier post illustrated how to extract information from XML inside PL/SQL.  This post is an example of the reverse of this, in that it shows how to create an XML document from a SQL statement.  These examples are based on creating an XML document providing details of the tables in the SCOTT schema but [...]]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>An <a href="http://www.mercatorgeosystems.com/blog/?p=5">earlier post</a> illustrated how to extract information from XML inside PL/SQL.  This post is an example of the reverse of this, in that it shows how to create an XML document from a SQL statement.  These examples are based on creating an XML document providing details of the tables in the SCOTT schema but could easily be adapted to suit your needs.</p>
<p>This first example extract the list of tables names and uses a combination of the XMLRoot, XMLElement, XMLAgg, XMLAttributes and XMLForest functions to create the document :</p>
<pre>SELECT XMLRoot(
         XMLElement("Tables",
           XMLAgg(XMLElement("Table",
             XMLAttributes(table_name),
               XMLForest(owner,
                         tablespace_name,
                         status,
                         num_rows)))
       ), VERSION '1.0', STANDALONE YES).getClobVal() as XMLDATA
  from all_tables
 where owner = 'SCOTT'</pre>
<p>This example returns a document like so :</p>
<pre>&lt;?xml version="1.0" standalone="yes"?&gt;
&lt;Tables&gt;
  &lt;Table TABLE_NAME="DEPT"&gt;
    &lt;OWNER&gt;SCOTT&lt;/OWNER&gt;
    &lt;TABLESPACE_NAME&gt;USERS&lt;/TABLESPACE_NAME&gt;
    &lt;STATUS&gt;VALID&lt;/STATUS&gt;
    &lt;NUM_ROWS&gt;4&lt;/NUM_ROWS&gt;
  &lt;/Table&gt;
&lt;/Tables&gt;</pre>
<p>etc etc.</p>
<p>To make this a little more useful (and complex!) we can add a nested query to return the column details in-line with the table information, like this :</p>
<pre>SELECT XMLRoot(
         XMLElement("Tables",
          XMLAgg(XMLElement("Table",
             XMLAttributes(at.table_name),
               XMLForest(at.owner,
                         at.tablespace_name,
                         at.status,
                         at.num_rows,
                         (select XMLAgg(XMLElement("Column",
                                   XMLAttributes(atc.column_name),
                                     XMLForest(atc.data_type,
                                               atc.data_length,
                                               atc.data_scale,
                                               atc.data_precision,
                                               atc.nullable)))
                           from all_tab_columns atc
                          where atc.owner = at.owner
                            and atc.table_name = at.table_name) as columns)))
         ), VERSION '1.0', STANDALONE YES).getClobVal() as XMLDATA
  from all_tables at
 where owner = 'SCOTT'</pre>
<p>which returns an XML document like so :</p>
<pre>&lt;?xml version="1.0" standalone="yes"?&gt;
&lt;Tables&gt;
  &lt;Table TABLE_NAME="DEPT"&gt;
    &lt;OWNER&gt;SCOTT&lt;/OWNER&gt;
    &lt;TABLESPACE_NAME&gt;USERS&lt;/TABLESPACE_NAME&gt;
    &lt;STATUS&gt;VALID&lt;/STATUS&gt;
    &lt;NUM_ROWS&gt;4&lt;/NUM_ROWS&gt;
    &lt;COLUMNS&gt;
      &lt;Column COLUMN_NAME="DEPTNO"&gt;
        &lt;DATA_TYPE&gt;NUMBER&lt;/DATA_TYPE&gt;
        &lt;DATA_LENGTH&gt;22&lt;/DATA_LENGTH&gt;
        &lt;DATA_SCALE&gt;0&lt;/DATA_SCALE&gt;
        &lt;DATA_PRECISION&gt;2&lt;/DATA_PRECISION&gt;
        &lt;NULLABLE&gt;N&lt;/NULLABLE&gt;
      &lt;/Column&gt;
      &lt;Column COLUMN_NAME="DNAME"&gt;
        &lt;DATA_TYPE&gt;VARCHAR2&lt;/DATA_TYPE&gt;
        &lt;DATA_LENGTH&gt;14&lt;/DATA_LENGTH&gt;
        &lt;NULLABLE&gt;Y&lt;/NULLABLE&gt;
      &lt;/Column&gt;
      &lt;Column COLUMN_NAME="LOC"&gt;
       &lt;DATA_TYPE&gt;VARCHAR2&lt;/DATA_TYPE&gt;
       &lt;DATA_LENGTH&gt;13&lt;/DATA_LENGTH&gt;
       &lt;NULLABLE&gt;Y&lt;/NULLABLE&gt;
     &lt;/Column&gt;
    &lt;/COLUMNS&gt;
  &lt;/Table&gt;
&lt;/Tables&gt;</pre>
<p>etc etc.<br />
I hope this is helpful to someone.  Most of the documentation that supports this post can be found <a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb13gen.htm">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating and using primary keys on views in Oracle</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=38</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=38#comments</comments>
		<pubDate>Wed, 02 Sep 2009 21:56:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[foreign key]]></category>
		<category><![CDATA[novalidate]]></category>
		<category><![CDATA[primary key]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=38</guid>
		<description><![CDATA[Hi,
Occasionally it may be useful to have a primary / foreign key relationship between a view and table, where the view is the primary key referenced by a column in the table.
Oracle doesn't let you do this quite as 'completely' as we'd probably like, but it at least let's you put in the building blocks [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Occasionally it may be useful to have a primary / foreign key relationship between a view and table, where the view is the primary key referenced by a column in the table.</p>
<p>Oracle doesn't let you do this quite as 'completely' as we'd probably like, but it at least let's you put in the building blocks which may help the CBO and make your database design more concise or elegant in places.</p>
<p>Here is a quick example :</p>
<pre>SQL&gt; create view pk_view
(item_id, item_name,
constraint pk_test_view primary key (item_id) rely disable novalidate)
as
select 1, 'One' from dual
union
select 2, 'Two' from dual
union
select 3, 'Three' from dual;
View created.
SQL&gt; create table fk_view (
item_id number references pk_view disable novalidate);
Table created.
SQL&gt;</pre>
<p>There, that's it.  Hope this helps someone as the create view syntax can be a little tricky.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=38</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use grep to match on the beginning of a line</title>
		<link>http://www.mercatorgeosystems.com/blog/?p=37</link>
		<comments>http://www.mercatorgeosystems.com/blog/?p=37#comments</comments>
		<pubDate>Tue, 09 Jun 2009 19:19:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Shell scripts]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.mercatorgeosystems.com/blog/?p=37</guid>
		<description><![CDATA[Hi
Just a simple one but a syntax that I can never remember when I need to so a quick post may help jog mine, and your, memory.  This grep syntax is for matching lines from a text file that begin with a particular word or expression :
$ grep -w '^Word' input_file.txt &#62; output_file.txt
This will search input_file.txt [...]]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>Just a simple one but a syntax that I can never remember when I need to so a quick post may help jog mine, and your, memory.  This grep syntax is for matching lines from a text file that begin with a particular word or expression :</p>
<pre>$ grep -w '^Word' input_file.txt &gt; output_file.txt</pre>
<div>This will search input_file.txt for lines that begin with 'Word' and then redirect the output to output_file.txt.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mercatorgeosystems.com/blog/?feed=rss2&amp;p=37</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

