06
Oct
21

AU2021 – InfraWorks Course

Here is a link to my “Create a 3D Model of Your City for Free” class:
https://events-platform.autodesk.com/event/autodesk-university-2021/planning/UGxhbm5pbmdfNjcwNDQ3

One question about animating cars – there is a workflow that exports a Component Road to AutoCAD Civil 3D, and then animates the cars on that road in 3DS Max – which is exported as COLLADA file and re-importing into InfraWorks.

Todd Rogers did an awesome job here:

06
May
19

Adding Tiled Map Services from ArcGIS to MapGuide

MapGuide 3.1.2 is recently out, and it has some really cool changes.  The best, IMO, is the XYZ Maps.

ESRI_MAPGUIDE_XYZ

For example, the ESRI Satellie MapServer (https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/)

If there are Tiles you can view them in MapGuide 3.1.2 (using MapGuide Maestro of course!).

Using the following syntax:

https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${z}/${y}/${x}

Notice the dollar signs before each of the XYZ items. This where MapGuide passes the XYZ to ArcGIS to get the correct tile.

For a few more to try:

ESRI Streets:
https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/${z}/${y}/${x}
Esri Topography:
https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}

 

Or you can use any ESRI Server with Tiles.  For example here is the State of New Jersey’s NJGINE GIS 2015 Aerials:

https://maps.nj.gov/arcgis/rest/services/Basemap/Orthos_Natural_2015_NJ_WM/MapServer/tile/${z}/${y}/${x}

Here is an example in Princeton, NJ:

ESRI_MAPGUIDE_XYZ_PRINCETON

So if you have an ArcGIS Server with Tiled layers, you can consume them in MapGuide Open Source 3.1.2 now!

 

 

 

25
Aug
18

ECW and MR SID with MapGuide Open Source (3.1.1)

So I keep Googling my own Post on Nabble, the MapGuide-Users forum where I describe how to roll out the ECW and MR SID Aerial Photo Support for MapGuide Open Source 3.1.1.

To save me, and anyone else time looking for it, I have posted the process here:

For MapGuide 3.1.1 in Windows 64 bit:

1. Download
http://download.gisinternals.com/sdk/downloads/release-1900-x64-gdal-2-2-mapserver-7-0.zip

2. Stop the MapGuide Service  (using Control Panel > Administrator tools > Services)

3, Unzip and copy contents of the BIN folder from the ZIP into the
C:\Program Files\OSGeo\MapGuide\Server\Fdo folder 

4. Copy the C:\Program Files\OSGeo\MapGuide\Server\Fdo\gdal\plugins folder
and paste it in the C:\Program Files\OSGeo\MapGuide\Server\bin folder.

5. Rename the plugins to gdalplugins so you end up with a folder called
C:\Program Files\OSGeo\MapGuide\Server\bin\gdalplugins 

6. Start the MapGuide Service (using Control Panel > Administrator tools > Services)

This works for me every time.

If you are migrating from Autodesk Infrastructure Map Server, you will have to re-create your Raster Data Sources, but just rename them the same name as the original and your layers will point to the new GDAL ones.

Example of new GDAL data source using multiple ECW files:

MGOS311_RASTER_WITH_GDAL

28
Nov
17

Editing SQL Server with MapWindow 5

In the past two posts, we saw how to edit with:

  • AutoCAD Map 3D
  • QGIS
  • ArcMap
  • ArcGIS Pro
  • MapInfo

In this video, we connect to the exact same table in SQL Server and try to edit with MapWindow 5.

24
Nov
17

Bonus SQL Server Spatial editing: MapInfo 16

In a previous post, I demonstrated editing SQL Server Spatial with 2 out of 3 standard GIS Desktop software.  Here is a 4th – MapInfo.

23
Nov
17

Comparison of SQL Server Editing with ArcMap, QGIS and AutoCAD Map 3D

Here is a quick video of me creating a very simple SQL Server table with a Geometry column, and try to edit data in 3 GIS Platforms:

  1. AutoCAD Map 3D 2018
  2. QGIS 2.18.14
  3. ArcMap 10.5.2

15
Jun
17

Magic of WKT (Well Known Text)

It’s been a long, long while since I posted anything, but I have been anything but idle.

I have been porting a lot of GIS Applications from Oracle Spatial to SQL Server Spatial. This is true for the Oracle OSE and the Topobase customers lately.

Typically Oracle 11g to Microsoft SQL Server 2014 is the migration path I have been following.

My first reaction is always to create a Safe Software FME batch file to do the translation but sometimes I like to do it the hard way.

I wanted a live view in SQL Server to look at the Oracle tables.  Normally very easy with a “Linked Server” in SQL Server.

linked

But, try doing this with Oracle’s SDO_GEOM datatype (NOT!).

Until I found the magic of Well Known Text (WKT).  This is a common Geometry standard that is shared between both SQL and Oracle.  It looks something like this:

POLYGON ((632995.706198033 6925343.8592000678, 632951.17949780729 6925366.6051015854, 632922.04199836869 6925309.5665011816, 632966.56860080548 6925286.8205018751, 632995.706198033 6925343.8592000678))

Now during the query to Oracle, I can ask for the SDO_GEOM column like this:

select SDO_UTIL.TO_WKBGEOMETRY(geom)  as wkt_geom from Parcels;

If I want to see that data in SQL Server, can query the linked server:

select geometry::STGeomFromText(wkt_geom, 26911) from [linked_oracle].gis_prod.Parcels;

NOTE: 26911 is UTM coordinate system.

So this little magic lets me go dynamically from Oracle to SQL Server without static translation.

Worth the wait I hope!

 

 

 

01
Aug
16

Paper Map to the rescue

Recently, on a road trip from my home in Guelph, I headed out on a road trip to Princeton New Jersey.

I was using Google Maps on my phone, but the power drained in my Moto G despite being plugged in.

I was map-less!

So, in the middle of Pennsylvania I stopped at the first gas station, no maps.  Went another 50km – no maps at that gas station either.  5 stations later I finally found a map – really small scale of North Eastern States.

So from now on, when the lights go out, I am always going to have a paper version of the map.

Like the boyscout motto: “Be Prepared”

13
May
16

ESRI Personal GeoDatabase in AutoCAD Map 3D 2017

The ESRI Personal GeoDatabase is an Access Database that contains spatial data.  If you want to quickly view this data you can add the OSGEO FDO Provider for OGR.

First download the OGR Provider from
http://download.osgeo.org/fdo/4.0.0/release/adsk/M040/binaries/win64/fdoogr-win64-4.0.0_4001.tar.gz

Copy the OGRProvider.dll into the C:\Program Files\Autodesk\AutoCAD 2017\Map\bin\FDO\ folder.

Within the same folder, open the Providers.xml in Notepad.

Add the following XML code:

<FeatureProvider>
<Name>OSGeo.OGR.4.0</Name>
<DisplayName>OSGeo FDO Provider for OGR </DisplayName>
<Description>Read/write access to spatial and attribute data OGR </Description>
<IsManaged>False</IsManaged>
<Version>4.0.0.0</Version>
<FeatureDataObjectsVersion>4.0.0.0</FeatureDataObjectsVersion>
<LibraryPath>OGRProvider.dll</LibraryPath>
</FeatureProvider>

Next, create an ODBC connection to the Personal GeoDatabase .

In Control Panel > Administrative Tools > ODBC Data Source (64-bit)

odbc

Browse to the Access File and add a new ODBC Connection.

odbc2

Finally, open AutoCAD  Map 3D 2017.

In the Display Manager, click Data > Connect to Data.

Choose Add OGR Connection.

For Connection Name, enter: OGR_<whatever you want>

For Data Source, enter: PGeo:<whatever you named the odbc>

MAP3D2017_OGR

Click Connect.

MAP3D2017_OGR2

Check the OGRSchema and click Add to Map.  All the data from within the Personal Geodatabase will be rendered in AutoCAD Map 3D.

MAP3D2017_OGR3

Since you now have OGR installed, all you have to do for each Personal Geodatabase is to create an ODBC link for each one.

For those who want to use this same Florida Personal Geodatabase, you can download it from:

http://www.dot.state.fl.us/planning/statistics/gis/geo.shtm

 

have fun!

 

 

 

 

18
Nov
15

ArcGIS Rest (MapServer) in MapGuide/Autodesk AIMS

Lately, there has been quite a lot of talk about inter-connectivity of various web-based GISs.  The quickest way to share is to ensure your web server is sharing data with WMS or WFS.

Unfortunately most organizations do not do this.

So I wanted to consume ArcGIS Server Rest services within Autodesk Infrastructure Map Server 2016 (aka MapGuide).  There is no FDO Provider for ArcGIS Rest (not yet anyway – great wishlist item!)

Using the default Sheboygan map data that comes with AIMS/MapGuide I figured I would drop the Soil Map from ArcGIS Online.

http://server.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer

First, we will use the Flexible Web Layout (Fusion) version of AIMS/MapGuide because it uses OpenLayers 2.13

I will use the SLATE template, so first I have to add ArcGIS Rest functionality to OpenLayers.

You will have to download the arcgisrest.js file and copy it to your folder:
C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2016\www\fusion\templates\mapguide\slate\

(I am using SLATE for this demo)

In the index.html file in the slate folder, add the following line to attach the arcgisrest.js you downloaded.

< script type="text/javascript" src="arcgisrest.js"></script>

Next we will create a js file called mc_arcgisrest.js that we will attach to the index.html page too.

< script type="text/javascript" src="mg_arcgisrest.js"></script>

The following code will give us a function that will toggle the layer from arcgis server on and off in the current layout:

var loadTimer;
var esriMapService;
var arcrestIsOn=false;

function showArcRestData(arcgisRestURL)
{
var watch = function() {
try {
var mapWidgetId = ‘Map’;
var mapWidget = Fusion.getWidgetById(mapWidgetId);
if (mapWidget && mapWidget.isMapLoaded() && mapWidget.isBusy() == false)
{
clearInterval(loadTimer);
var OL=OpenLayers;
if(arcrestIsOn == false)
{
esriMapService = new OL.Layer.ArcGIS93Rest(“ArcGIS Dynamic MapService”, arcgisRestURL + “/export”, {
transparent:true,
isBaseLayer:false,
srs: “EPSG:3857”,
BBOXSR: “3857”,
IMAGESR: “3857”
});
mapWidget.oMapOL.projection=new OL.Projection(“EPSG:3857”);
mapWidget.oMapOL.displayProjection=new OL.Projection(“EPSG:3857”);

mapWidget.oMapOL.addLayers([esriMapService]);
arcrestIsOn=true;
}
else
{
mapWidget.oMapOL.removeLayer(esriMapService);
arcrestIsOn=false;
}
}
}
catch(e) {
alert(e);
}
};
loadTimer = setInterval(watch, 500);
}

So now you have two js files you add to your index.html page in the SLATE template (I usually put them under the fusionSF.js link:

< script type="text/javascript" src="../../../lib/fusionSF.js"></script>
< script type="text/javascript" src="arcgisrest.js"></script>
< script type="text/javascript" src="mg_arcgisrest.js"></script>

Finally, add a button in your menubar in Autodesk Infrastructure Studio.  I am using the existing Slate Flexible Layout at: Library://Samples/Sheboygan/FlexibleLayouts/Slate.ApplicationDefinition

In the Toolbar (Main Menu) create a new Invoke Script.

AIMS_STUDIO_INVOKESCRIPT_ARCGIS

Notice the script calls:

showArcRestData("http://server.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer");

Once you add that, click “View In Browser” and try the button.

AIMS_ARCGIS

 

Now you can add any MapServer Rest Service to your MapGuide/AIMS map.

 




Gordon Luckett

Arrow Geomatics Inc's Gordon Luckett

Contact

gordon dot luckett at arrowgeo dot com 1-519-837-9500 (Arrow Geomatics Inc.)

Checkout MapGuide Guy’s Youtube Channel