다양한 모양의 외부지도 파일 형식 (예 : ShapeFiles, MapPoint, KML 등)을 구문 분석하고 중앙 집중식 데이터베이스에 사용될 중앙 데이터베이스에 모양을 저장하는 응용 프로그램을 구축 중입니다. 매핑 /보고 기반. 지금은 점의 추상 배열로 표현되는 선이 있으며,이를 데이터베이스 (SQL2012 Express)에 저장 될 sqlGeography 객체로 변환하려고합니다. 나는 그 문자열에서이 작업을 수행 .NET을 사용하여 sqlGeography LINESTRING 만들기
LINESTRING(41.942587758675 -85.636084221926,41.9425261573997 -85.6360833224383,41.9423450573927 -85.6360807217602,41.9423035553449 -85.6360801225198,41.9421639573891 -85.6360781210972,41.9421098574371 -85.6360773225739,41.9420307561342 -85.6360762213003)
(VB.NET) 내가 추가 한
Dim strSql As New SqlChars(New SqlString(strGeo))
Dim geo As SqlGeography = SqlGeography.STLineFromText(strSql, 4326)
: 여기
은 (문자열 strGeo에 저장) 내 스트링 문의 예 SQL Server 2012 기능 팩에서 Microsoft.SqlServer.Types에 대한 적절한 참조가 필요하지만 디버거가 SqlGeography 행에 도달하면 다음과 같이 나타납니다.System.DllNotFoundException: Unable to load DLL 'SqlServerSpatial110.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Microsoft.SqlServer.Types.GLNativeMethods.GeodeticIsValid(GeoMarshalData g, Double eccentricity, Boolean forceKatmai, Boolean& result, Boolean& isSmallerThanAHemisphere)
at Microsoft.SqlServer.Types.GLNativeMethods.GeodeticIsValid(GeoData& g, Double eccentricity, Boolean forceKatmai)
at Microsoft.SqlServer.Types.SqlGeography.IsValidExpensive(Boolean forceKatmai)
at Microsoft.SqlServer.Types.SqlGeography..ctor(GeoData g, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeography.STLineFromText(SqlChars lineStringTaggedText, Int32 srid)
at ShpFileProcessor.Module1.ProcessFile(FileInfo fil) in C:\Users\Chet Cromer\documents\visual studio 2010\Projects\NorthernLights\ShpFileProcessor\ShpFileProcessor\Module1.vb:line 180
내 컴퓨터의 어느 곳에서나 SqlServerSpatial110.dll을 찾을 수 없습니다. SQL Express 2012가 설치되어 있고 SYSTEM32 및 SYSWOW64에서 SqlerverSpatial.dll을 찾을 수 있지만 VS에서 해당 파일을 등록 할 수 없습니다.
내가 이렇게 내 선 스트링에서 두 괄호를 사용하는 경우 나 다른 오류가 나타났습니다 :
LINESTRING((41.942587758675 -85.636084221926,41.9425261573997 -85.6360833224383,41.9423450573927 -85.6360807217602,41.9423035553449 -85.6360801225198,41.9421639573891 -85.6360781210972,41.9421098574371 -85.6360773225739,41.9420307561342 -85.6360762213003))
System.FormatException: 24141: A number is expected at position 27 of the input. The input has (41.942587758675.
at Microsoft.SqlServer.Types.WellKnownTextReader.RecognizeDouble()
at Microsoft.SqlServer.Types.WellKnownTextReader.ParseLineStringText()
at Microsoft.SqlServer.Types.WellKnownTextReader.ParseTaggedText(OpenGisType type)
at Microsoft.SqlServer.Types.WellKnownTextReader.Read(OpenGisType type, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeography.ParseText(OpenGisType type, SqlChars taggedText, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeography.STLineFromText(SqlChars lineStringTaggedText, Int32 srid)
at ShpFileProcessor.Module1.ProcessFile(FileInfo fil) in C:\Users\Chet Cromer\documents\visual studio 2010\Projects\NorthernLights\ShpFileProcessor\ShpFileProcessor\Module1.vb:line 180
(당신이 문자를 계산하기 전에, 위치 (27)는 최초의 위도/경도 콤보 사이의 공간입니다)
첫 번째 문자열 형식이 올바른 형식이지만이 시점에서 확실하지 않으며 SqlServerSpatial110.dll 문제를 어떻게 처리해야할지 모르겠습니다.
아무도이 길을 잃은 적이 있습니까? 내가 놓친 게 있니?
나는이 같은 문자열을 사용하여 확인 내 라인이 너무 복잡하지 만들기 위해 노력했습니다. –
안녕하세요, 저는 MSDN을 읽는 편이 좋습니다. http://msdn.microsoft.com/en-us/library/ee642119(v=sql.105).aspx – Ali