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)
- Null value HOT 9
- Invalid geometry type provided (Polygon). Expected: Multilinestring HOT 1
- Problem with saving attributes readed from existing file HOT 1
- Cannot Write Shapefile with LineStrings using ShapefileWriter HOT 2
- nuget out of date HOT 5
- Saving geometries with Z=NaN HOT 3
- GDBWriter and GDBReader classes removed? HOT 6
- Allow DbfCharacterField support 255 length. HOT 3
- Add stream support
- Do not write SHP files that are over 2gb HOT 2
- Handling of duplicate attribute-names HOT 2
- Read a prj
- The projection stream is closed. Please leave all streams open. HOT 4
- Import a shape with 0-decimal column, but with decimal anyway HOT 2
- Issue with 'L' Column in DBF with Length greater than 1. HOT 1
- Do not write BOM (byte order mark) in projection file HOT 2
- Unable to write single POLYGONs to SHP file HOT 1
- NetTopologySuite.IO.Esri.ShapefileException:“Invalid polygon geometry.” HOT 4
- Can you read .prj to create SpatialReference? HOT 2
- Error processing numeric fields in scientific notation with `DbfNumericDecimalField`
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.