Archive Page 3

30
Jul
12

Two Free Ways to Push Geographic Data in SQL Server

If you own SQL Server 2008 or higher (even the free Express version) you have the essentials of a GIS. 

But how to put GIS data into SQL Server?  I cover 2 simple ways to get data into SQL Server:

  1. SharpGIS’s SQL Server Spatial Tools http://www.sharpgis.net/page/sql-server-2008-spatial-tools.aspx
  2. OGR2OGR as part of the GDAL Suite at http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries

If you downloads SharpGIS’s tool, you can load a ShapeFile (actually it is series of files such as Road.shp, Road.dbf, Road.idx..) into SQL Server.

 SharpGIS's Shapefile Uploader

In the Configure Dialog dialog box, you need to log into SQL Server, enter the SQL Server name and choose the database.

ShareGIS Shapefile Uploader Configure

If you shapefile has a coordinate system that is projected, such as State Plane or UTM, you should use the Geometry, otherwise choose Geography (Latitude and Longitude).

Also, I recommend not to create the Spatial Index right away as I find this often causes errors during load with this tool.

Leave the default Table Name, Geometry Name and Key Name and click Upload to Database.

To view the data, open the Microsoft SQL Server Management Studio and expand the Databases to your current database.

Right-click On your Table and choose Select Top 1000 Rows to see the SHP you just loaded.

Now, to load the same SHP File, you will have to use the Command Prompt with the OGR2OGR Tool.

To create a BAT or batch file, simply create a text file and save it with a .bat extension.

In the *.bat file, first add the path of the OGR2OGR.exe:

“C:\Program Files\GDAL\ogr2ogr.exe”

Then add the -f MSSQLSpatial switch to import into SQL Server.

Next, add the connection to SQL Server:
“MSSQL:server=HOGWARTS\SQLEXPRESS;database=WORLD;trusted_connection=yes”

Finally, add the path of where the Shapefile is:
 D:\Projects\DMTI\SHP\RAIL75.shp

Full entry:
“C:\Program Files\GDAL\ogr2ogr.exe” -f MSSQLSpatial  “MSSQL:server=HOGWARTS\SQLEXPRESS;database=WORLD;trusted_connection=yes”  D:\Projects\DMTI\SHP\RAIL75.shp

Finally, double-click on the ogr.bat file or whatever you named it, and the SHP file will be loaded into SQL Server.

To view the data, open the Microsoft SQL Server Management Studio and expand the Databases to your current database.

The additional dbo.geometry_columns and dbo.spatial_ref_sys are used by Open Source GISs such as QGIS to determine the spatial data columns and their coordinate system.  QGIS can render the data without these support tables however, so they are not required.

24
May
12

Google Popup from OpenLayers and MapGuide/AIMS – gone!

Like many people yesterday, I noticed all my MapGuide/AIMS sites suddenly had a “Map Data” popup in the middle of my map.

Why is this here today?

So how to fix it?
Opent the file:
C:\Program Files\OSGeo\MapGuide\Web\www\fusion\lib\OpenLayers\theme\default\style.css

and add the following around line 30:

.olLayerGoogleV3.olLayerGooglePoweredBy {  
    visibility:hidden !important;
    bottom: 15px !important; 
}
.olLayerGooglePoweredBy.olLayerGoogleV3.gmnoprint {
visibility:hidden !important;
}

19
Mar
12

ContourGPS Video and MapGuide (AIMS 2012)

What is a ContourGPS camera?

A small light full HD video camera with GPS capabilities. The GPS adds speed, location and elevation to the picture. The GPS receiver automaps the three essentials up to four times per second. The GPS synchronizes with your video and displays a second by second replay via Google Maps, Bing or OpenStreetMaps.  All within the MapGuide/AIMS 2012 environment.

1. Upload Video and Associated GPS file to web server (code loads the GPS points into SQL Server and creates path in map).

2. Video list in Interface and choose video to watch.

3. Video plays and animated point follows the path in sync with the video.

03
Mar
12

Mobile viewers for iPad

Gordon’s been using the Autodesk Infrastructure Map Server 2012 (AIMS/MapGuide) mobileviewer;  customizing mobile viewers for the iPad with out-of-the-box Open Layers code to search and draw points using Google Geocoder API.

02
Feb
12

Groundhog Day – Arrow Geomatics Inc 13th Year

Wiarton Willie does not see his shadow, thus 6 more weeks of winter.

Where is Wiarton?  Click this link to see it in OpenStreetMap.

30
Jan
12

Flow Arrows and Custom Linetypes in AIMS 2012 (aka MapGuide)

So a lot of people want to recreate the look and feel of the maps they created in AutoCAD, even though precise engineering drawings are not cartographically accurate.

That being said there is definely a way to recreate the flow arrows and Leaders from AutoCAD in AIMS.

If you have a line layer in AutoCAD you will either have to export it to SDF, SHP, Oracle Spatial, SQL Server Spatial, or any other “FDO” type data.

Connect to that data in AIMS and modify the layer style in AIMS 2012 Studio.

In the Style Lne dialog:

  1. Ensure to use “Map” units
  2. Chose your units (feet or meters typically)
  3. Under Symbol and Style, click Add Symbol.

 4. Under Select Symbol, choose Triangle.

5.  For height, type your height in feet or if you have it as a column in your data, choose that.

6. For width, do the same as step 5.

7. Click Advanced.

8. If you want to put an arrow at the beginning of the line, enter 0 for Offset from Start, do not type anything for “from end” and set the Repeat interval to 0.

9. For Rotation, enter: 90

If you change the Offset for the End to be 0 and the beginning empty, the arrow will appear at the other end of the line.
This is very effective for AutoCAD Leaders and Flow Arrows.  Also, you can use text instead of triangle, to get a custom line.
For example: Choosing Text instead of Triangle, you can repeat the text along the line to create a custom line time
The cool thing is you can do this in Map 3D 2012 as well, for any FDO based layer.
 Also, you can save as a .LAYER file, load back into AutoCAD Map 2011 and use the Publish to MapGuide to retro your advanced layer definition into MapGuide 2011.
 Normally you would have to hack around in XML to get this to work with MapGuide 2011.
 If you have Map 3D 2012 you can now create .LAYER files with all this neat stylization and use the .LAYER retroactively.
28
Nov
11

Instantly Publish your DWG from AutoCAD Map 3D to AIMS (MapGuide) but why would you?

Alright, I love the ability to push my DWG from AutoCAD Map 3D into MapGuide – I almost never need to open MapGuide/AIMS Studio.

So what is the issue?

AutoCAD Map 3D has had a great tool for creating custom properties for every object in your AutoCAD drawing: it’s called “Object Data”.   For example, if you have a polyline, text or block that you want to add your own information to, such as diameter or data installed.

So what happens to this amazing custom Property called Object Data when you publish it to MapGuide aka Autodesk Infrastruture Map Server 2012?

Watch this video to find out:

16
Nov
11

Introduction to MapGuide OpenSource – from FOSS4G in Denver

It looks like my technical tutorial from FOSS4G last September is now posted.

MapGuide 2.2 Tutorial (Part 1 of 2)

MapGuide 2.2 Tutorial (Part 2 of 2)

This is where I actually use the Youtube videos seen at http://youtube.com/mapguideguy/

 

11
Nov
11

Dongjin Xing’s – Introduction to MapGuide Enterprise (circa MapGuide 2007) Programming

This Video was put on the Autodesk Developer Network (ADN) for MapGuide 2007 – it is a few years old, but it is a great introduction to programming with MapGuide in .NET.

29
Oct
11

ArcGIS 10 and AutoCAD Map 3D 2012: drop ArcSDE and all the dll dependancies!

Another big topic: accessing ArcGIS Server 10 with AutoCAD Map 3D. Usually you will see demos and blog posts on how to move the dlls of the ArcGIS Runtime or Map install into the FDO folder of AutoCAD Map 3D so you can use ArcSDE.

What if you usually connect ArcMap with Direct Connect and don’t even want to use SDE?
What if you only have Map 3D and don’t want to buy the ArcGIS runtime?

In this video, I show the traditional ArcSDE way of connecting to ArcGIS 10 server, and then I show how you can set up your ArcGIS data so that it can be viewed AND edited by 3rd party products such as AutoCAD Map 3D 2012.




Gordon Luckett

Unknown's avatar

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


Design a site like this with WordPress.com
Get started