Comments (5)
Good point. The Shapefile.WriteAllFeatures()
method does not have an option to specify the projection. For now you have to use ShapefileWriter
with explictly specified options:
var geoReader = new GeoJsonReader();
var features = geoReader.Read<FeatureCollection>(GeoJsonData);
var prop0 = new DbfCharacterField("prop0");
var prop1 = new DbfCharacterField("prop1");
var options = new ShapefileWriterOptions(ShapeType.Polygon, prop0, prop1)
{
Projection = @"GEOGCS[""GCS_WGS_1984"",DATUM[""D_WGS_1984"",SPHEROID[""WGS_1984"",6378137.0,298.257223563]],PRIMEM[""Greenwich"",0.0],UNIT[""Degree"",0.0174532925199433]]"
};
var shpPath = "C:\\Temp\\Issue016.shp";
using (var shpWriter = Shapefile.OpenWrite(shpPath, options))
{
shpWriter.Write(features);
}
from nettopologysuite.io.esri.
from nettopologysuite.io.esri.
from nettopologysuite.io.esri.
Dear @kronetix
What I need to do is to export WKT files for the shape file
Regards,
from nettopologysuite.io.esri.
Thanks @KubaSzostak, this is a great solution.
from nettopologysuite.io.esri.
Related Issues (20)
- WRONG Question TO BE IGNORED
- DBF * in numeric field HOT 6
- Create Shapefile From WKT failed HOT 2
- Editing attribute data of an existing shapefile, using VB.NET HOT 2
- Ensure ShapefileReader does not use Geometry.Empty member
- Reprojection HOT 1
- How do I get the Feature Id? HOT 2
- How to write Shapefile header HOT 4
- Invalid Polygon Issue HOT 3
- Multi-polygon bringing in extra/redundant polygons? HOT 6
- Reading in invalid dates HOT 1
- Merge https://github.com/FObermaier/SharpSbn HOT 1
- PointZ shapefiles are not properly read HOT 2
- Project status HOT 12
- Is there a way to get shapefile field aliases? HOT 2
- Null value HOT 9
- Create Shapefile From WKT failed HOT 6
- Add Test project from NetTopologySuite.IO.ShapeFile repository HOT 1
- Issue in ReadGeometry with a Multipolygon ESRI shapefile HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nettopologysuite.io.esri.