공간 참조 시스템
Contents
[
Hide
]
공간 참조 시스템 생성
EPSG 식별자(SRID)로 공간 참조 시스템 생성
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
var srs = SpatialReferenceSystem.CreateFromEpsg(26918); | |
Console.WriteLine("SRS Name: {0}", srs.Name); // NAD83 / UTM zone 18N | |
Console.WriteLine("SRS EPSG code: {0}", srs.EpsgCode); // 26918 | |
Console.WriteLine("Datum name: {0}", srs.GeographicDatum.Name); // North_American_Datum_1983 | |
Console.WriteLine("Datum EPSG code: {0}", srs.GeographicDatum.EpsgCode); // 6269 | |
Console.WriteLine("Ellipsoid name: {0}", srs.GeographicDatum.Ellipsoid.Name); // GRS 1980 | |
Console.WriteLine("Ellipsoid EPSG code: {0}", srs.GeographicDatum.EpsgCode); // 6269 | |
Console.WriteLine("Type: {0}", srs.Type); // Projected | |
Console.WriteLine("Dimensions count: {0}", srs.DimensionsCount); // 2 | |
Console.WriteLine("First dimension name: {0}", srs.GetAxis(0).Name); // X | |
Console.WriteLine("First dimension direction: {0}", srs.GetAxis(0).Direction); // East | |
Console.WriteLine("Second dimension name: {0}", srs.GetAxis(1).Name); // Y | |
Console.WriteLine("Second dimension direction: {0}", srs.GetAxis(1).Direction); // North | |
Console.WriteLine("First dimension unit: {0}, {1}", srs.GetUnit(0).Name, srs.GetUnit(0).Factor); // metre, 1 | |
Console.WriteLine("Second dimension unit: {0}, {1}", srs.GetUnit(1).Name, srs.GetUnit(1).Factor); // metre, 1 |
WKT(Well-Known text)에서 공간 참조 시스템 생성
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
string wkt = @" | |
GEOGCS[""WGS 84"", | |
DATUM[""WGS_1984"", | |
SPHEROID[""WGS 84"",6378137,298.257223563, | |
AUTHORITY[""EPSG"",""7030""]], | |
AUTHORITY[""EPSG"",""6326""]], | |
PRIMEM[""Greenwich"",0, | |
AUTHORITY[""EPSG"",""8901""]], | |
UNIT[""degree"",0.01745329251994328, | |
AUTHORITY[""EPSG"",""9122""]], | |
AUTHORITY[""EPSG"",""4326""]] | |
"; | |
var srs = SpatialReferenceSystem.CreateFromWkt(wkt); | |
Console.WriteLine("SRS Name: {0}", srs.Name); // WGS 84 | |
Console.WriteLine("SRS EPSG code: {0}", srs.EpsgCode); // 4326 | |
Console.WriteLine("Datum name: {0}", srs.GeographicDatum.Name); // WGS_1984 | |
Console.WriteLine("Datum EPSG code: {0}", srs.GeographicDatum.EpsgCode); // 6326 | |
Console.WriteLine("Ellipsoid name: {0}", srs.GeographicDatum.Ellipsoid.Name); // WGS 84 | |
Console.WriteLine("Ellipsoid EPSG code: {0}", srs.GeographicDatum.EpsgCode); // 7030 | |
Console.WriteLine("Type: {0}", srs.Type); // Geographic | |
Console.WriteLine("Dimensions count: {0}", srs.DimensionsCount); // 2 | |
Console.WriteLine("First dimension name: {0}", srs.GetAxis(0).Name); // Longitude | |
Console.WriteLine("First dimension direction: {0}", srs.GetAxis(0).Direction); // EAST | |
Console.WriteLine("Second dimension name: {0}", srs.GetAxis(1).Name); // Latitude | |
Console.WriteLine("Second dimension direction: {0}", srs.GetAxis(1).Direction); // NORTH | |
Console.WriteLine("First dimension unit: {0}, {1}", srs.GetUnit(0).Name, srs.GetUnit(0).Factor); // degree, 0.01745... | |
Console.WriteLine("Second dimension unit: {0}, {1}", srs.GetUnit(1).Name, srs.GetUnit(1).Factor); // degree, 0.01745... | |
var geogSrs = srs.AsGeographic; | |
Console.WriteLine("Angular unit: {0}, {1}", geogSrs.AngularUnit.Name, geogSrs.AngularUnit.Factor); // degree, 0.01745... | |
Console.WriteLine("Prime meridian: {0}, {1}", geogSrs.PrimeMeridian.Name, geogSrs.PrimeMeridian.Longitude); // Greenwich, 0 |
사용자 지정 매개변수로 공간 참조 시스템 생성
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
var parameters = new ProjectedSpatialReferenceSystemParameters | |
{ | |
Name = "WGS 84 / World Mercator", | |
Base = SpatialReferenceSystem.Wgs84, | |
ProjectionMethodName = "Mercator_1SP", | |
LinearUnit = Unit.Meter, | |
XAxis = new Axis("Easting", AxisDirection.East), | |
YAxis = new Axis("Northing", AxisDirection.North), | |
AxisesOrder = ProjectedAxisesOrder.XY, | |
}; | |
parameters.AddProjectionParameter("central_meridian", 0); | |
parameters.AddProjectionParameter("scale_factor", 1); | |
parameters.AddProjectionParameter("false_easting", 100); | |
parameters.AddProjectionParameter("false_northing", 100); | |
var projectedSrs = SpatialReferenceSystem.CreateProjected(parameters, Identifier.Epsg(3395)); |
공간 참조 시스템 작업
공간 참조 시스템에 대한 드라이버 지원 확인
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
Drivers.Shapefile.SupportsSpatialReferenceSystem(SpatialReferenceSystem.Wgs72); // true | |
Drivers.GeoJson.SupportsSpatialReferenceSystem(SpatialReferenceSystem.Wgs84); // true | |
Drivers.GeoJson.SupportsSpatialReferenceSystem(SpatialReferenceSystem.Wgs72); // false |
공간 참조 시스템을 WKT로 내보내기
Well-known text(WKT)는 지도상의 벡터 기하 객체, 공간 객체의 공간 참조 시스템 및 공간 참조 시스템 간의 변환을 나타내는 텍스트 마크업 언어입니다. Aspose.GIS API를 사용하면 다음 샘플 코드와 같이 WKT에서 공간 참조 시스템을 만들 수 있습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
var parameters = new ProjectedSpatialReferenceSystemParameters | |
{ | |
Name = "WGS 84 / World Mercator", | |
Base = SpatialReferenceSystem.Wgs84, | |
ProjectionMethodName = "Mercator_1SP", | |
LinearUnit = Unit.Meter, | |
XAxis = new Axis("Easting", AxisDirection.East), | |
YAxis = new Axis("Northing", AxisDirection.North), | |
AxisesOrder = ProjectedAxisesOrder.XY, | |
}; | |
parameters.AddProjectionParameter("central_meridian", 0); | |
parameters.AddProjectionParameter("scale_factor", 1); | |
parameters.AddProjectionParameter("false_easting", 0); | |
parameters.AddProjectionParameter("false_northing", 0); | |
var projectedSrs = SpatialReferenceSystem.CreateProjected(parameters, Identifier.Epsg(3395)); | |
string wkt = projectedSrs.ExportToWkt(); | |
Console.WriteLine(wkt); |
공간 참조 시스템 비교
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
string wkt = @" | |
GEOGCS[""WGS 84"", | |
DATUM[""WGS_1984"", | |
SPHEROID[""WGS 84"",6378137,298.257223563, | |
AUTHORITY[""EPSG"",""7030""]], | |
AUTHORITY[""EPSG"",""6326""]], | |
PRIMEM[""Greenwich"",0, | |
AUTHORITY[""EPSG"",""8901""]], | |
UNIT[""degree"",0.01745329251994328, | |
AUTHORITY[""EPSG"",""9122""]], | |
AUTHORITY[""EPSG"",""4326""]] | |
"; | |
var srs = SpatialReferenceSystem.CreateFromWkt(wkt); | |
srs.IsEquivalent(SpatialReferenceSystem.Wgs84); // true |