Archive | April, 2012

Gaming and the City

24 Apr

As a child I loved SimCity. Building a city was a lot of fun, but having Godzilla destroy my city was even better. The city building franchise started in 1989 and 23 years later you can pre-order the newest release. While there are games – like SimCity, that are all about building cities – for many other games, cities have long provided the backdrop for the game play. As game technology has progressed, the freedom you have to explore the city in the game has grown. This has required more realistic rendering of cities. The companies that build these digital cities are being bought up by Architecture, Engineering and Planning firms. ESRI, the makers of geographic information software, recently purchased Procedural, the makers of CityEngine – a software for making 3D city models. While the companies involved in video gaming and building real cities are becoming harder to differentiate, urban hackers are also blurring the lines between video games and real life.

Read the rest at The Urban Times.

Report Revit Unconnected Wall Height

16 Apr

Saw someone searching for this. Revit does not report Unconnected wall height so how can you put it in a schedule?

Algebra!

Area = Length*Height

Revit reports Area and Length. Solve for Height and:

Unconnected Wall Height = Area/Length

Create a Calculated Value Parameter and put in that formula to report unconnected height.

Query Multiple WMS Layers in Leaflet.js

16 Apr

In an earlier post I imported GeoJSON in to Leaflet. One of the reasons I did this was to be able to assign a popup to each layer – which is something I could not do with WMS. I was finally able to make a popup for each of my WMS layers. Here is how I did it.

I have 2 layers -psfa:SchoolPoints and psfa:CityOfAztec – on my GeoServer at: http://localhost:8080/geoserver/psfa/wms.

I made a Leaflet map importing these two layers.

Image

The cloudmade layer that is added is my base map. With the layers showing up correctly, I found the website of Bryan McBride. I copied his WMS example and then modified it for my server and layers.

Image

var URL = the location of my GeoServer.

GetFeatureInfo&LAYERS=my layers seperated by a ,

Lastly, do the same for &QUERYLAYERS= seperaed by a ,

This is how I was able to get my map to popup the correct info when I clicked on any WMS layer in my map. Next, I need to clean up the popup box to fit my data without scrolling. It looks like if you want to change the formatting of the popup internals, GeoServer has some WMS templates. I am not that far yet.

Final Map

 

Leaflet.js and GeoJSON

12 Apr

Recently, I have been playing with a few different open source GIS tools and Leaflet.js has been one I really like – OpenLayers is next on my To-Do list. In this post, I will show a very simple example of loading GeoJSON point data in to a map and then adding a popup to the points. I modified the example from the Leaflet website, stripping out other ways of doing it and simplified the GeoJSON to one data object. I think for newbies like myself, this made it much easier to understand.

Here is a screen shot of the final map – 2 points with a popup.

The Final Leaflet.js Map.

The following is the GeoJSON I used – it contains 2 points.

GeoJSON file saved as .js

Now in the webpage, I create a Leaflet map and use the GeoJSON file. Here is the code:

Here is what’s happening:

Import the GeoJSON data: <script src=”MyGeoJSONforLightRail.js” type=”text/javascript”></script>

Create a place to put the map: <div id=”map” style=”width: 600px; height: 400px”></div>

Add a map named same as place we want to put it: var map = new L.Map(‘map’);

Add a base map, set the map zoom, add the base layer to the map:

var cloudmadeUrl = ‘http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/22677/256/{z}/{x}/{y}.png’, cloudmadeAttribution = ‘Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade’,  cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});

map.setView(new L.LatLng(39.747, -105), 14).addLayer(cloudmade);

Create and empty GeoJSON Layer: var lightRailGeojsonLayer = new L.GeoJSON();

Attach a popup: lightRailGeojsonLayer.on(“featureparse”, function (e) {
var popupContent = “<p>I started out as a GeoJSON ” + e.geometryType + “, but now I’m a Leaflet vector!</p>”;
popupContent += “<p>This is the default look of a GeoJSON Point.</p>”;
if (e.properties && e.properties.popupContent) {
popupContent += e.properties.popupContent;
}
e.layer.bindPopup(popupContent);
});

Note on Popup: The += following popupContent is appending to the string. You will see it 3 times.

Add the blank GeoJSON layer to the map: map.addLayer(lightRailGeojsonLayer);

Populate the layer with the .js file we included in the header (MyGeoJSONforLightRail.js):

lightRailGeojsonLayer.addGeoJSON(lightRailStop);

Note on populating: the (lightRailStop) is the name of the var in the MyGeoJSONLightRail.js file:

var lightRailStop = {
“type”: “FeatureCollection”,
“features”: [ blah blah blah…..

 

There you go. Change the GeoJSON to your file, modify the map setView, and edit the popup and you have your own map. For more examples go to the Leaflet page.

 

 

Fulcrum Mobile Data Collection

2 Apr

I recently posted on Mapping a Graveyard with Field Assets App. In this post, I am going to show how I collect GIS data in the field using my iPhone and the free Fulcrum App.

I created a free account on the Fulcrum website. After creating the account I started a new project and created a form.

Use the tools available on the left to create any type of form. Load the form in to your project and it’s ready to use.

 

Now I have a project and a form to capture my field data.

Using TileMill – a tool for creating maps and exporting as mbtiles – I added some data – Census Blocks for Albuquerque – and exported the map as a mbtile.

Next, upload the map to Fulcrum.

With the map loaded, you now have a project,  a form, and a map – so let’s get started.

 

Open up the iPhone App and select your project. You will see your project and current location in a basemap.

Click the maps button on the bottom of the screen, you will see which basemap you are using and an option to upload your own. Upload your own and select your mbtile map.

My tile is not the best, I just loaded up a very small file with almost no zoom. You should, and can, do much better.

Now that I have my Census Blocks in an mbtile, I can collect data using my own basemap. What I like even more than having my own basemap is that I can download it and use it without having internet access.

now you can add a data point.

 

 

 

 

 

And, see the accuracy of the point by swiping the top of the screen.

I have been told that you will be able to manually place points – instead of using current location – in future updates of the App.

What I like about this App is the ability to customize my data collection forms with ease, add my own basemaps, and use my maps offline. Also, with the free version I can export my data as CSV and KML – without photos.

Yes, Spatial Networks sells a monthly service with this app. for $9 a month you get 20 forms for a single user and CSV and KML export with photos. For $20 a month you get unlimited forms and users and you can export to CSV, KML, SHP, and GeoJSON. — all with photos.

There are an increasing number of GIS services becoming available online but I am sticking to the ones that allow me to export my data out in the formats I need. Fulcrum lets you export out as GeoJson – I think this is cool for being able to incorporate my data in to my Leaflet.js maps and other applications I build myself.If you use JavaScript, then JSON is an easy way to transfer data.