Using satellite imagery as roof textures in CityEngine

Before we start the code I used here came from a GIS mapping tutorial from CityEngine, I can’t seem to find the original page after them being merged with ESRI but you can see a cached copy of the page here.

First let us get some satellite imagery, I suggest you use an extract from an existing satellite imagery from your GIS. If you are taking the imagery from elsewhere you don’t need to follow all these steps…

  1. In ArcGIS — Draw a box using the Draw toolbar
  2. In ArcGIS – Select the underlying imagery in the Table of Contents right-click and select “Data –> Export Data”. Depending on what your are doing and the size of imagery you want you may want to use JPG and the settings below have worked for me. I suggest you experiment for the best results. I also suggest you export straight to the maps directory in your CityEngine project
  3. In CityEngine — Drag and drop from your maps directory into your CityEngine scene, it should come in under any data you already have. If it doesn’t check that in the Scene window the map layer does not have the eye crossed out also ensure that the show/hide map layers button is clicked.
  4. In CityEngine – Create a new rule file and copy this code in (be sure to change the relevant parts to your settings).
    # dimension of the satellite map
    const mapdimension_x = 1134.181 #change this to satellite image details
    const mapdimension_z = 939.650 #change this to satellite image details
    # offset of the satellite map
    const mapoffset_x = 597694.521 #change this to satellite image details
    const mapoffset_z = -3560369.907 #change this to satellite image details
    Lot-->
    extrude(rand(3,15)) Mass
    Mass -->
    # split building mass into roof and side faces
    comp(f){top : Roof | side : Facade}
    Roof --> Rooftex
    Rooftex -->
    setupProjection(0, world.xz, mapdimension_x, mapdimension_z)
    set(material.colormap, "maps/SATELLITEIMAGENAME.jpg") #change this
    projectUV(0)
    translateUV(0, -mapoffset_x/mapdimension_x, -mapoffset_z/mapdimension_z)
    scaleUV(0,1,-1)
  5. In CityEngine – To get the x-size and x-offset numbers select the map layer in the Scene window (default location bottom left) and look at the Layer tab in the Inspector window (default right), copy these numbers to the const variables at the beginning of the rule file.
  6. In CityEngine – Now apply that rule (after changes to your shapes/lots) and generate your model!

 

{lang: 'en-GB'}

Trivialising Digitising and Analysis : Gamification of GIS?

Just so you are forewarned, this is a bit of a ramble….

angryArcGIS

You know you want it....

It came to me in day dream whilst using ArcGIS to digitise my second city for the day, for use in a master planning project. I really quite enjoy the process of plotting roads from a base of satellite imagery. Maybe its just me but there really is something supremely satisfying watching a clean satellite image fill up with little road centre lines. It’s like helping my 2 and ½ year old daughter with her colouring book (or dot-to-dot)… (ok so she’s watching TV and I’m colouring)

Yes! 5000 points for snapping!

Then it struck me what if little clicks and noises (perhaps even a rumbling mouse) would happen every time I laid a vertex or snapped to a feature? You could even have a score table each vertex and snapping got you a point. Every time you came to move an existing vertex a point was deducted! Wow, you could even get a bonus for using complicated analysis

“Congratulations you’ve just earned the Geostatisical Analyst Interpolation badge”

Would it annoy me or spur me on? I had to look in to this….

So apparently this concept is called ‘Gamification’ (I know I looked it up on Wikipedia so it must be true… ) a stupid sounding word that covers the idea of using the psychology of rewards to encourage the adoption of technology.

Yay! Let us treat people like idiots & encourage them to work by rewarding them with arbitrary numbers non-existent prizes….

erm…

… except I might quite like aspects about that, of course I absolutely rule out sharing my scores on facebook or twitter with other geo-professionals… I know I would be last and I’m pretty sure @cageyjames would win…

Come on ESRI (or QGIS I don’t mind) gamify my work … and integrate it with Facebook and Twitter I DARE you …. just don’t share my scores with Klout (hey OpenStreetMap sort of does it)

{lang: 'en-GB'}

Thunderbird is a no go… Folder Pane empty – Solved! – Corrupt folderTree.json

Okay a specific post for those who use Thunderbird as an email client.   Basically I had some issues with my brand new PC where it BSOD (Blue Screen Of Death) almost immediately (turned out to be a loose fan in the tower!).   Upon fixing the PC I could open Thunderbird but not see any folders in the Folder Pane on the left.

So here’s the solution (I used the error console in Thunderbird to search for a possible solution):

  1. Navigate in Windows to the your Thunderbird profile folder (e.g. “C:\Users\YOURUSERNAME\AppData\Roaming\Thunderbird\Profiles\SOMETHINGHERE.default)
  2. Find the file “folderTree.json” back it up first and then delete it (or just rename it OLDfolderTree.json)
  3. Now load up Thunderbird, your problem should have been fixed (it seems to create a new file)!

SOURCES (this conservation helped me) : https://bugzilla.mozilla.org/show_bug.cgi?id=707329

 

{lang: 'en-GB'}

ArcGIS and CityEngine : careful when you smooth!

Interesting issue I’ve come across going back and forth from CityEngine to ArcGIS.   Importing a file geodatabase (GDB) CityEngine doesn’t see my results from smoothing edits.

How I thought it was drawn...

  1. Draw a feature in ArcGIS  in a File Geodatabase (GDB), then run the smooth tool on the Advanced Editing toolbar.
  2. Import the File GeoDatabase into CityEngine (when doing an import it seems you have to click back and then forward to refresh the GDB contents…).
  3. Now look at the same feature in CityEngine, it’s not straight is it?

    That's not how I thought I did it....

  4. So export the feature as a shapefile instead and import into CityEngine, the feature retains its smoothness.

Not sure whether its a bug or my misunderstanding of a feature… I guess a smooth is described in a GDB rather than drawn, whereas shapefiles just draw the feature via vertices.   Either way it’s a good example of knowing the limitations of your file formats!

{lang: 'en-GB'}

ArcGIS – CityEngine – SketchUp – Lumion3D – A workflow

I’m quite partial to a good workflow, so here’s the result of one I’ve posted on GeoPlanIT’s YouTube channel:

Lumion3D is a great rendering/visualisation tool I hope to be using much more in the future.   It might not give you full control over everything but if you want quick and easy renderings of your models it’s brilliant.   A word of caution though, you might want to upgrade your graphics card… (or like me your entire PC).   You can download a free (limited feature) trial now from here.

{lang: 'en-GB'}
Mini-Bio
You can find out more about me here at : http://about.me/elliothartley
Twitter Updates
GeoPlanITon