Display rotated objects on the map

Topics: SharpMap Project, SharpMap v0.9 / v1.x, SharpMap v2.0
Dec 23, 2008 at 2:24 PM
Hi all,

Great library... I'm beginning in using it and have a few questions!

- I'd like to display sea stream currents as arrows on a Map. This currents have 3 attributes: position (lon/lat), force, direction. I have tried to use VectorLayer with a collection of Geometry Points, and changing the style.symbol with a bitmap of an arrow, and the rotation attribute. But i'm not sure it's the correct way to proceed.

- I'm interested in using SharpFiles to display the world coastal boundaries. It looks rather simple, but where could i find free SharpFiles?

Any input would be appreciated!


Dec 23, 2008 at 2:28 PM
Continuing my searches, i've just found that Styles based on featured data may be a good way of investigation. Link of an example:

Am I right?
Jan 11, 2009 at 1:57 PM
Hi all,

Since last post i've continued on working on this subject and i still need help. I must say i'm a beginner on Geospatial subject, and despite my good level of programmation, i cannot understand how to use Sharmap in my specific context.

First question: How to display objects which information (position, name, ...) are in an XML file. I've created a Dataset from the XSD schema of the XML file and i load my data inside. Well ... now i need input on Providers, FeatureDataTable and so on...  Should I create a FeatureDataTable, fill it and add it in a GeometryProvider? Do you have any example that i could adapt? What about performance (using geometryprovider)?

Second question: Where could i find examples of shapefiles?


Jan 11, 2009 at 5:01 PM
Hi Jeff, I think you are on the right path with creating a FeatureDataTable and adding all your (including your attribute data) then you can use a GeometryFeatureProvider (if you want labelling) or GeometryProvider (if you just want vectors). The performance should be fine, but you will probably want to cache the data between renders (i.e dont keep recreating the FeatureDataTable) I am not aware of any demo code you can adapt, however the FeatureDataTable is very similar to a normal DataTable so you should be ok.

Free shapefiles depend on where you are and who owns the data, some countries have free datasets some dont. There is always OpenStreetMap (www.openstreetmap.org)  data which can be downloaded in shapefile format from various places including http://downloads.cloudmade.com/ You may also find some linked data from http://www.geographynetwork.com/explorer/explorer.jsp?goTo=search&type=002 

hth jd
Jan 11, 2009 at 5:51 PM
Hi John,

Great answer, i'll keep working on it.

About Shapefiles, thx i'll try to find what i'm looking for. By the way my need is really simple: i just want a map of world coastal boundaries, just like the one on your third link which allow to choose data (on left part of the page)

Jan 12, 2009 at 1:50 PM
Hi all,

A few questions still to be answered...

  1. I have some difficulties to create a FeatureDataTable: I've tried using the constructor method taking a DataTable as parameter, but i think it doesn't work because my DataTable should have specific columns... Who knows the specific columns name/type that should be present?
  2. I use compiled version 0.9 (downloades the two dll from the site), and i cannot find the GeometryFeatureProvider that John is talking about... I'm therefore using GeometryProvider. My final objective is to use custom styles depending on some attributes of my FeatureDataTable, will it work?
  3. I'd like to find the code of 0.9 version in order to improve my capacity to work without help or documentation. I manage to access V1 and V2 code, but where is 0.9 one? I decided to stay on 0.9 version because i have very basic needs, and want a stable version. Am i right?
Any help, even partial, appreciated.


Jan 12, 2009 at 2:13 PM
Edited Jan 12, 2009 at 2:16 PM
Hi Jeff, 0.9 is the trunk on codeplex (unfortunately the naming pre v2 is a bit out of sync).. It is much more up to date than the compiled version on the 'release' tab. You may find that your initial issue with the constructor is resolved using the latest 0.9 code.. cheers jd
Jan 12, 2009 at 10:43 PM

 I found and compiled the code. It' a HUGE help, because the code has evolved, and the examples are running and up to date, and comments on code are really more detailed than the help HLP file in release.

You (if admin of the application) should definetly update the home page, just by explainning that best info should be found on this trunk version. It is not at all straightforward, and it takes 5 minutes to update with a link in the home page. It's just my 2 cents piece, with a complete newbie vision of sharpmap.

Thx a lot.