Click here to Skip to main content
15,891,713 members
Home / Discussions / C#
   

C#

 
GeneralRe: Parameterless Webbrowser-constructor crashes with "The parameter is incorrect" Pin
plokkoville11-May-07 4:16
plokkoville11-May-07 4:16 
GeneralRe: Parameterless Webbrowser-constructor crashes with "The parameter is incorrect" Pin
Luc Pattyn11-May-07 7:14
sitebuilderLuc Pattyn11-May-07 7:14 
QuestionGIS programming Pin
cols291011-Apr-07 5:11
cols291011-Apr-07 5:11 
AnswerRe: GIS programming Pin
Ed.Poore11-Apr-07 6:03
Ed.Poore11-Apr-07 6:03 
GeneralRe: GIS programming Pin
cols291011-Apr-07 20:40
cols291011-Apr-07 20:40 
GeneralRe: GIS programming Pin
Ed.Poore11-Apr-07 23:52
Ed.Poore11-Apr-07 23:52 
GeneralRe: GIS programming Pin
cols291012-Apr-07 0:11
cols291012-Apr-07 0:11 
GeneralRe: GIS programming Pin
Ed.Poore12-Apr-07 0:53
Ed.Poore12-Apr-07 0:53 
Well I've done a lot of work with Ordnance Survey Grid References[^] but these deal only with Cartesian coordinates, i.e. an X and a Y.  The first major question to ask yourself is are you going to deal with 2D data or 3D.  I realise that coordinate systems aren't that straight forward because of the skews etc.

But basically what you would want is if you can load your image of the town with a known coordinate, e.g. the top-left corner of the town-hall is so many degress/minutes/seconds north and west then when you read in your GIS data you can use this as your origin for calculations.
cols2910 wrote:
but I am unsure how to code this into an actual viewer.

So if I've understood you correctly you can read the vector files but don't know how to display them?

If you don't know how to draw them then you have 3 possibilities (well actually two), you can use GDI+ with C#, Managed DirectX or WPF.  What I meant by having 2 is that WPF uses DirectX internally and even is easily capable of 2D or 3D data very simply as well as all the graphics transformations.  However if you're not on Vista or XP SP2 then you're stuck on that front.

For example I've got portions of Great Britain in the OS format 1:25000 (1km = 4cm), these are stored as pictures 200 pixels by 200 pixels.  With this information I know that the name of the picture refers to the Grid Reference in the bottom left corner of the picture.  200 pixels then equals 1km.

So if I wanted to plot the point SN512876 I would draw the pictures stored in file SN510870.png (this is the point 51km west and 87km north of the origin for the grid code SN, see linked article if you want to know more).  That's the base image loaded (the town in your case), I then have to plot the more accurate point.

So for the X coordinate (in pixels) from the bottom-left of the picture:
x = (512 - xOffset) * ScalingFactor
y = (876 - yOffset) * ScalingFactor
Where the xOffset = 510 and yOffset = 870.  The scaling factor in this instance is 20 because 200 pixels = 1km so 0.1 of a km = 20 pixels.

So in summary the most important things to get are a known coordinate on the image and the scaling of the image, for example you need to know how wide / tall the image is so that you can scale things accordingly.



GeneralRe: GIS programming Pin
cols291012-Apr-07 1:04
cols291012-Apr-07 1:04 
GeneralRe: GIS programming Pin
Ed.Poore12-Apr-07 1:31
Ed.Poore12-Apr-07 1:31 
QuestionVisual Studio 2003. CVSRepo Pin
123456uio11-Apr-07 4:47
123456uio11-Apr-07 4:47 
QuestionDatagrid sorting Pin
mehmetned11-Apr-07 4:21
mehmetned11-Apr-07 4:21 
AnswerRe: Datagrid sorting Pin
thomasa11-Apr-07 4:42
thomasa11-Apr-07 4:42 
Questionmanual updation in clickonce,Deployment Pin
pashitech11-Apr-07 4:10
pashitech11-Apr-07 4:10 
AnswerRe: manual updation in clickonce,Deployment Pin
Ed.Poore11-Apr-07 23:54
Ed.Poore11-Apr-07 23:54 
QuestionRegistring COM object Pin
Stevo Z11-Apr-07 3:41
Stevo Z11-Apr-07 3:41 
AnswerRe: Registring COM object Pin
Stevo Z11-Apr-07 4:22
Stevo Z11-Apr-07 4:22 
QuestionAdding WebDav Server to Windows Application Pin
Komil11-Apr-07 3:19
Komil11-Apr-07 3:19 
QuestionProblem in inserting large amount of records in XML file Pin
Affan Toor11-Apr-07 2:33
Affan Toor11-Apr-07 2:33 
AnswerRe: Problem in inserting large amount of records in XML file Pin
Colin Angus Mackay11-Apr-07 2:48
Colin Angus Mackay11-Apr-07 2:48 
AnswerRe: Problem in inserting large amount of records in XML file Pin
andre_swnpl11-Apr-07 2:51
andre_swnpl11-Apr-07 2:51 
AnswerRe: Problem in inserting large amount of records in XML file Pin
Not Active11-Apr-07 2:52
mentorNot Active11-Apr-07 2:52 
AnswerRe: Problem in inserting large amount of records in XML file Pin
Jaiprakash M Bankolli11-Apr-07 3:14
Jaiprakash M Bankolli11-Apr-07 3:14 
QuestionCRUD using listview [modified] Pin
danielwinata11-Apr-07 2:11
professionaldanielwinata11-Apr-07 2:11 
AnswerRe: CRUD using listview Pin
Jaiprakash M Bankolli11-Apr-07 3:17
Jaiprakash M Bankolli11-Apr-07 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.