FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SharpMap/Examples/WinFormSamples/Program.cs at main · SharpMap/SharpMap · GitHub
SharpMap
SharpMap
Repository navigation
Code
Issues
42
(42)
Pull requests
6
(6)
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
SharpMap
/
Examples
/
WinFormSamples
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (37 loc) · 1.63 KB
Breadcrumbs
SharpMap
/
Examples
/
WinFormSamples
/
Program.cs
Copy path
File metadata and controls
43 lines (37 loc) · 1.63 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using
System
;
using
System
.
Windows
.
Forms
;
using
System
.
Text
;
using
NetTopologySuite
;
using
ProjNet
.
CoordinateSystems
;
using
ProjNet
.
CoordinateSystems
.
Transformations
;
namespace
WinFormSamples
{
internal
static
class
Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[
STAThread
]
private
static
void
Main
(
)
{
var
gss
=
new
NtsGeometryServices
(
)
;
var
css
=
new
SharpMap
.
CoordinateSystems
.
CoordinateSystemServices
(
new
CoordinateSystemFactory
(
)
,
new
CoordinateTransformationFactory
(
)
,
SharpMap
.
Converters
.
WellKnownText
.
SpatialReference
.
GetAllReferenceSystems
(
)
)
;
// plug-in WebMercator so that correct spherical definition is directly available to Layer Transformations using SRID
var
pcs
=
(
ProjectedCoordinateSystem
)
ProjectedCoordinateSystem
.
WebMercator
;
css
.
AddCoordinateSystem
(
(
int
)
pcs
.
AuthorityCode
,
pcs
)
;
GeoAPI
.
GeometryServiceProvider
.
Instance
=
gss
;
SharpMap
.
Session
.
Instance
.
SetGeometryServices
(
gss
)
.
SetCoordinateSystemServices
(
css
)
.
SetCoordinateSystemRepository
(
css
)
;
// for SqlServerSample referencing SharpMap.SqlServerSpatialObjects
//SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
Application
.
EnableVisualStyles
(
)
;
Application
.
SetCompatibleTextRenderingDefault
(
false
)
;
Application
.
Run
(
new
DlgSamplesMenu
(
)
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL