POST
|
You can use Ogr2ogr to do the conversion. MSSQLSpatial - Microsoft SQL Server Spatial Database
... View more
08-17-2018
10:30 AM
|
0
|
0
|
966
|
POST
|
How do I get the value of dateFieldsTimezoneID without logging into rest admin? If someone changes this from the default then I can't just convert the UTC value to local on the frontend, correct? I would need to know what the dateFieldsTimezoneID value is right?
... View more
03-21-2018
06:51 AM
|
0
|
0
|
1014
|
POST
|
For anyone having this issue in 10.4.1. Looks like its a bug in ArcObjects. Doesn't get fixed until 10.5.1. arcobjects - IFeatureCursor.NextFeature not releasing memory - Geographic Information Systems Stack Exchange
... View more
10-04-2017
08:38 AM
|
0
|
0
|
607
|
POST
|
gm.moorthi I'm having the same issue. Whenever I try to access FieldDefs, its null. Did you solve this?
... View more
05-17-2017
08:37 AM
|
0
|
1
|
963
|
IDEA
|
This bug has been around for almost a year. Kind of surprised it hasn't been fixed yet since it already does it for features without arcs. https://geonet.esri.com/thread/170662
... View more
03-13-2017
10:37 AM
|
1
|
0
|
265
|
IDEA
|
This bug has been around for almost a year. Kind of surprised it hasn't been fixed yet since it already does it for features without arcs. https://geonet.esri.com/thread/170662
... View more
03-13-2017
10:37 AM
|
1
|
0
|
248
|
IDEA
|
No, I'm talking about the .NET bindings. Will the .NET bindings work on Linux? · Issue #5 · Esri/file-geodatabase-api · GitHub
... View more
03-13-2017
10:32 AM
|
0
|
1
|
1258
|
IDEA
|
With the explosion of new .NET projects coming out on Linux and Mac. I think support for this on those platform's would help spread the File Geodatabase Format.
... View more
03-10-2017
10:57 AM
|
8
|
8
|
1633
|
POST
|
Yes I think people would want a feature that properly calculates the area in a gis library.
... View more
04-08-2016
06:16 AM
|
0
|
1
|
913
|
POST
|
So I finally got a chance to get back to this problem. Code that creates 1 feature with an arc in it. When you look at that feature in ArcMap it doesn't have the correct area or length. using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Esri.FileGDB;
using System.IO;
namespace GeoDBTest
{
class Program
{
static void Main(string[] args)
{
CPoint[] arrPoints = {
new CPoint(280216.393,336991.323),
new CPoint(280218.563,336609.378),
new CPoint(280116.567,336609.378),
new CPoint(280116.567,336993.493),
new CPoint(280216.393,336991.323)
};
// arc lies between point 1 & 2
CArc arc = new CArc(new CPoint(280116.567, 336993.493), new CPoint(280116.567, 336609.378), new CPoint(279953.806, 336801.436));
Geodatabase geodatabase = null;
string geoPath = "geoTest.gdb";
geodatabase = OpenGeoDB(geoPath);
Table tblTestArea = null;
if(geodatabase != null)
{
ClearTable(geodatabase);
tblTestArea = OpenGDBTable(geodatabase);
if(tblTestArea != null)
{
int iMultipart = 1, iPoints = 5, iArcs = 1;
uint iSize = (uint)(4 * sizeof(int) + iMultipart * sizeof(int) + 4 * sizeof(double) + (2 * sizeof(double) * iPoints) + ((sizeof(int) * 3 + sizeof(double) * 2) * iArcs));
int offset = 0;
Byte[] shapeBuffer = new Byte[iSize];
// type
int type = (int)Esri.FileGDB.ShapeType.GeneralPolyline;
type = 536870963; //Byte 29,28 ON and Byte 0 is 51
Buffer.BlockCopy(BitConverter.GetBytes(type), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
// Extent
// 280116.567 336609.378
// 280220.013 336607.577
// minimum X
Buffer.BlockCopy(BitConverter.GetBytes(arc.pMidPoint.dX), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
// minimum Y
Buffer.BlockCopy(BitConverter.GetBytes(arrPoints[2].dY), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
// 280218.563 336991.323
// 279945.499 336995.913
// maximum X
Buffer.BlockCopy(BitConverter.GetBytes(arrPoints[0].dX), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
// maximum Y
Buffer.BlockCopy(BitConverter.GetBytes(arrPoints[0].dY), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
// number of parts
Buffer.BlockCopy(BitConverter.GetBytes(iMultipart), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
// number of points
Buffer.BlockCopy(BitConverter.GetBytes(iPoints), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
// load number of parts
Buffer.BlockCopy(BitConverter.GetBytes(0), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
// Load all points
for (int pt = 0; pt < arrPoints.Count(); pt++)
{
Buffer.BlockCopy(BitConverter.GetBytes(arrPoints[pt].dX), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
Buffer.BlockCopy(BitConverter.GetBytes(arrPoints[pt].dY), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
}
// number of Arcs
int numCurves = 1;
Buffer.BlockCopy(BitConverter.GetBytes(numCurves), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
// Load ARC
//segment point index - arc is starting from point 2
Buffer.BlockCopy(BitConverter.GetBytes(2), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
//segment type 1- circular arc
Buffer.BlockCopy(BitConverter.GetBytes(1), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
// ESRI expecting the center point of the 2 cord not the center of the circle (curve)
CPoint arcMidPoint = arc.pMidPoint;
// Center point
Buffer.BlockCopy(BitConverter.GetBytes(arcMidPoint.dX), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
Buffer.BlockCopy(BitConverter.GetBytes(arcMidPoint.dY), 0, shapeBuffer, offset, sizeof(double));
offset += sizeof(double);
// It doesn't matter it calculates the arc based on the mid point
int minor = 16;
int bits = 256 | 128 | 0 | 0 | minor | 0 | 4 | 2 | 0;
// copy bits
Buffer.BlockCopy(BitConverter.GetBytes(bits), 0, shapeBuffer, offset, sizeof(int));
offset += sizeof(int);
// Loading to the Geo Table
Row polyRow = tblTestArea.CreateRowObject();
ShapeBuffer polylinesGeometry = new ShapeBuffer(iSize);
polylinesGeometry.Allocate(iSize);
polylinesGeometry.shapeBuffer = shapeBuffer;
polylinesGeometry.inUseLength = iSize;
//MultiPartShapeBuffer multiGeometry = polylinesGeometry;
polyRow.SetGeometry(polylinesGeometry);
tblTestArea.Insert(polyRow);
tblTestArea.Close();
tblTestArea.Dispose();
geodatabase.Close();
geodatabase.Dispose();
}
}
}
static Geodatabase OpenGeoDB(string geoDbPath)
{
Geodatabase geodb = null;
try
{
try
{
geodb = Geodatabase.Open(geoDbPath);
}
catch (Exception ex)
{
//ignore if file is not present
}
try
{
if (geodb == null)
{
geodb = Geodatabase.Create(geoDbPath);
}
}
catch (Exception ex)
{
}
}
finally
{
}
return geodb;
}
static Table OpenGDBTable(Geodatabase geodatabase)
{
Table geodbTbl = null;
string catPath = "";
string tblName = "";
string templatePath = @"PARCELS_TEMPLATE.xml";
try
{
string featureClassDef = "";
using (StreamReader sr = new StreamReader(templatePath))
{
while (sr.Peek() >= 0)
{
featureClassDef += sr.ReadLine() + "\n";
}
sr.Close();
}
catPath = @"/FD=CAD2GIS/FC=" + "AreaTest";
tblName = "AreaTest";
featureClassDef = featureClassDef.Replace("_CATLOGPATH_", catPath);
featureClassDef = featureClassDef.Replace("_TABLENAME_", tblName);
geodbTbl = geodatabase.CreateTable(featureClassDef, "");
}
catch (Exception ex)
{
}
finally
{
}
return geodbTbl;
}
static Table ClearTable(Geodatabase geodatabase)
{
string tblName = "";
Table tblData = null;
tblName = "AreaTest";
try
{
geodatabase.Delete(tblName, "Table");
}
catch (Exception ex)
{
}
finally
{
}
return tblData;
}
} // end class
class CPoint
{
public double dX;
public double dY;
public CPoint(double x, double y)
{
dX = x;
dY = y;
}
}
class CArc
{
public CPoint pStartPoint;
public CPoint pEndPoint;
public CPoint pMidPoint;
public CArc(CPoint SPoint, CPoint EPoint, CPoint MPoint)
{
pStartPoint = new CPoint(SPoint.dX, SPoint.dY);
pEndPoint = new CPoint(EPoint.dX, EPoint.dY);
pMidPoint = new CPoint(MPoint.dX, MPoint.dY);
}
}
}
... View more
04-07-2016
08:14 AM
|
1
|
9
|
913
|
POST
|
I'v already sent ESRI support a code sample. Just waiting to see what they find. I'll update this thread when I find out.
... View more
01-22-2016
10:31 AM
|
0
|
11
|
913
|
POST
|
This problem is with the File Geodatabase API not with Arcobjects.
... View more
01-22-2016
05:46 AM
|
0
|
13
|
554
|
POST
|
So let me get this straight. Are you saying any data created using the File Geodatabase API is not guaranteed to work in ArcGIS Desktop correctly? I thought the point of the API was to read and write official file geodatabase's.
... View more
01-11-2016
12:26 PM
|
0
|
3
|
554
|
Title | Kudos | Posted |
---|---|---|
1 | 04-07-2016 08:14 AM | |
1 | 04-15-2020 08:32 AM | |
2 | 03-25-2019 05:30 AM | |
8 | 03-10-2017 10:57 AM | |
1 | 03-13-2017 10:37 AM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|