question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Polygon exported to WKB with "wkbExportDefaults" has type of multipolygon

See original GitHub issue

OperatorExportToWkbLocal doesn’t properly handle wkbExportDefaults - exported WKB has “multipolygon” (6) type written instead of “polygon” (3).

Here is reproducible example:

package ljader.test;

import java.nio.ByteBuffer;

import com.esri.core.geometry.OperatorExportToWkb;
import com.esri.core.geometry.Polygon;
import com.esri.core.geometry.WkbExportFlags;

public class WkbExportPolygonWrongType {
	public static void main(String[] args) {
		ByteBuffer byteBuffer = OperatorExportToWkb.local().execute(WkbExportFlags.wkbExportDefaults, createPolygon1(), null);
		// WKB Polygon type is 3
		System.out.println(byteBuffer.getInt(1)); // outputs 6
	}

	public static Polygon createPolygon1() {
		Polygon poly = new Polygon();
		poly.startPath(0, 0);
		poly.lineTo(10, 10);
		poly.lineTo(0, 10);
		poly.lineTo(0, 0);
		return poly;
	}
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stolstovcommented, Apr 12, 2018

@ljader Thank you, I’ve submitted a PR to fix the typo: https://github.com/Esri/geometry-api-java/pull/171. There is no bug I think, but the typo is misleading.

0reactions
ljadercommented, Apr 12, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Export polygon from shapefile as type - qgis
Run Multipart to Singleparts from the processing toolbox, then export the result as GeoJSON.
Read more >
Well-Known Binary (WKB) - GEOS
Standard WKB supports two-dimensional geometry, and is a proper subset of both extended WKB and ISO WKB. Data Types. The WKB specification uses...
Read more >
wkb: Convert Between Spatial Objects and Well-Known Binary ...
Supported WKB geometry types are Point, LineString, Polygon, MultiPoint, MultiLineString, and. MultiPolygon. All elements in the list must have ...
Read more >
more about Spatial SQL: WKT and WKB - SpatiaLite Cookbook
SpatiaLite supports a Geometry data type conformant to the ... two polygons: the first one has an interior ring ... MULTIPOLYGON .
Read more >
Casting Polygons As Multipolygons? - Google Groups
recovered, since they have type mismatches. Because of this no export to shapefile is possible. I was hoping the MultiPolygonFromWKB fx would accept...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found