|  Home  |  Map Suite  |  Cygnus Track
    LivePerson Chat

ThinkGeo Blog

Providing GIS and GPS tracking insight.

 Monday, February 25, 2008

Map Suite has the ability to edit existing shapefiles, but what if you want to create your own?

The code below should get you started, but if you want to explore more shapefile editing check out our EditShapeFile sample application included with the evaluation download.


Below is a very simple example of creating a point based shapefile from scratch. It adds three records and fills the value for the field “Name”.

 

C# 

Private DatabaseColumns Columns = new DatabaseColumns();

private DatabaseColumn Column1;

Column1.FieldType = FieldDataType.fdtString;
Column1.Length = 15;

Column1.DecimalLength = 0;

Column1.Name = "Name";

Columns.Add(Column1);

Map1.CreateNewShapefile(ShapeTypeEnum.Point, "C:\\thinkgeo\\temp", "Test", Columns);

Layer Layer = new Layer("C:\\thinkgeo\\temp\\test.shp", false);

Layer.BeginEdit();

int Shape1 = Layer.AddShape(new PointShape(-98, 19));

Layer.UpdateTableData(1, "Name", "Record1");

int Shape2 = Layer.AddShape(new PointShape(-97, 15));

Layer.UpdateTableData(2, "Name", "Record2");

int Shape3 = Layer.AddShape(new PointShape(-98, 20));

Layer.UpdateTableData(3, "Name", "Record3");

Layer.CommitEdit();

 

 

 

VB.NET

Dim Columns As New DatabaseColumns

Dim Column1 As DatabaseColumn

Column1.FieldType = FieldDataType.fdtString

Column1.Length = 10

Column1.DecimalLength = 0

Column1.Name = "Name"

Columns.Add(Column1)

 

Dim Column2 As DatabaseColumn

Column2.FieldType = FieldDataType.fdtDouble

Column2.Length = 5

Column2.DecimalLength = 2

Column2.Name = "Acres"

Columns.Add(Column2)

Dim strPath As String = "C:\Projects\ThinkGeo\"

Dim strName As String = "Steve"

Map1.CreateNewShapefile(ShapeTypeEnum.Polygon, strPath, strName, Columns)

 

Map1.MapUnit = MapSuite.Geometry.MapLengthUnits.DecimalDegrees

 

Dim Layer As New Layer(strPath & strName, False)

Layer.BeginEdit()

Dim Shape As New Polygon()

Dim dblacres As Double = 90.31

Dim shape1 As Integer = Layer.AddShape(Shape)

 

Layer.UpdateTableData(shape1, "Acres", dblacres.ToString)

Layer.UpdateTableData(shape1, "Name", "Record1")

Layer.CommitEdit()

Layer.BuildIndex()
Layer.BuildRecID("Recid", True)

 

Comments [0] - Trackback Posted February 25, 2008 at 5:34 PM by Ryan Desemo   #   
Topics: Map Suite Desktop | Map Suite Engine | Map Suite Web
 Monday, February 18, 2008

Over the years it has sometimes been difficult to visually show customers how our products can fit together to build various types of .NET applications.  Since Map Suite can support several .NET application types including Pocket PC, Desktop, Web, Web Services, Windows Services and console applications, a lot of times it's not clear which Map Suite product is best suited for the task.  Enlisting the help of our very talented graphic designer, we now have a Map Suite product relationship diagram that visually shows how the different Map Suite products can fit together to build various types of .NET applications.

Now I know what they mean when they say a picture is worth a 1000 words!

Comments [0] - Trackback Posted February 18, 2008 at 5:07 PM by Clint Batman   #   
Topics: General | Map Suite Desktop | Map Suite Engine | Map Suite Web
 Tuesday, February 12, 2008

Over the past few months I have been working more and more with WMS Web Services.  WMS stands for Web Map Service and is an open standard set by the Open Geospatial Consortium this standard was designed so heterogeneous map data sources can be shared remotely via an Internet connection. 

In my exploration of WMS over the past few months I have found several free WMS web services that can provide valuable mapping data to your application.  My top 3 favorite WMS Web Services include:

1. National NEXRAD Radar Imagery

WMS URL:  http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi

Layer Name: nexrad-n0r-m45m

Description:  Provides updates of the National NEXRAD Base Reflectivity Radar sites very 45 minutes.

 

2. USGS Topo Maps from TerraServer

WMS URL: http://terraserver-usa.com/ogccapabilities.ashx

Layer Name: DOQ

Description: These are handy Topo maps from the USGS.

3.  Landsat Imagery from NASA

WMS URL: http://onearth.jpl.nasa.gov/wms.cgi

Layer Name: global_mosaic

Description:  Provides an easy way to add NASA Landsat imagery to your application. 

In case you want to consume these web services inside of an application using our Map Suite .NET controls I have provided some sample code below:

        If Not Page.IsPostBack Then
            Map1.MapUnit = MapLengthUnits.DecimalDegrees

            Dim StateLayer As New MapSuite.Layer(Server.MapPath("") + "\SampleData\STATES.shp", True)
            StateLayer.ZoomLevel01.GeoStyle = GeoAreaStyles.GetSimpleAreaStyle(MapSuite.GeoColor.KnownColors.Transparent, MapSuite.GeoColor.KnownColors.Black)
            StateLayer.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.ZoomLevel18

            Map1.Layers.Add(StateLayer)

            Dim wmsUrl As String = "http://onearth.jpl.nasa.gov/wms.cgi"
            Dim myLayer1 As New WmsLayer("Global", wmsUrl)
            myLayer1.AddLayer("global_mosaic")
            myLayer1.AddStyle("visual")
            myLayer1.Active = True
            myLayer1.SetImageFormat("image/png")
            myLayer1.SRCSystem = "EPSG:4326"
            myLayer1.TimeOutInSeconds = 15

            Map1.WmsLayers.Add(myLayer1)

            Map1.CurrentExtent = New RectangleR(-177.42, 99.53, 71.78, -77.56)
        End If

Technorati Tags: , ,

 

Comments [2] - Trackback Posted February 12, 2008 at 12:26 PM by Clint Batman   #   
Topics: Map Suite Desktop | Map Suite Engine | Map Suite Web
 Friday, February 08, 2008

I have always been a big fan of slashdot.org for getting my daily dose of technical news, and now I have slashgeo.org for keeping up on geospatial news.  Over the years I have run across this site a time or two, but there didn't seem to be much activity on it until lately.  The past few weeks I have been monitoring it more closely and they have had great postings.  I hope they can keep it up, because it's been difficult in the past to find a good centralized location for spatial news. 

Check it out and help the slashgeo.org community grow!

Technorati Tags: ,

Comments [0] - Trackback Posted February 8, 2008 at 2:45 PM by Clint Batman   #   
Topics: General

Today I released a new white paper and code explaining how to build scalable GIS applications with web services.  The paper gives sample code for both the web service and the client application using Map Suite Web & Engine Editions.  In this case the client application was a web application, but the same concepts can be used to consume the web service in a desktop application.  This type of application architecture works really well for both scalability and allowing you centralize the large base map datasets.

Below is a screen shot of what the result of the sample client application look like.  We even used the new Map Suite Icon library for the customer icons :)

Sample Application Screenshot

Technorati Tags: , ,

Comments [0] - Trackback Posted February 8, 2008 at 2:12 PM by Clint Batman   #   
Topics: General | Map Suite Desktop | Map Suite Engine | Map Suite Web

Well it's official, the ThinkGeo Blog is finally live! 

After several conversations about how we could use blogging to better communicate with our customers and the community in general, we are ready to launch.  The main focus of this blog will be to allow people within the ThinkGeo organization to talk about cool topics like GIS (Geographic Information Systems), programming and mapping technologies, to name a few.  In addition, we also hope this blog will engage our customers on how to utilize our technologies to implement great solutions.

Technorati tags: ,

Comments [0] - Trackback Posted February 8, 2008 at 1:27 PM by Clint Batman   #   
Topics: General
Archive
<February 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
2425262728291
2345678
Statistics
Total Posts: 11
This Year: 11
This Month: 0
This Week: 0
Comments: 4
Administration
Sign In