Skip to content

Commit

Permalink
fix OGR_G_ImportFromWkb signature changed in OSGeo/gdal@9074666#diff-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Tilak committed Jul 24, 2018
1 parent cda1b1b commit 9920f95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ogr.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ type Geometry struct {

//Create a geometry object from its well known binary representation
func CreateFromWKB(wkb []uint8, srs SpatialReference, bytes int) (Geometry, error) {
cString := (*C.uchar)(unsafe.Pointer(&wkb[0]))
pabyData := (unsafe.Pointer(&wkb[0]))
var newGeom Geometry
return newGeom, C.OGR_G_CreateFromWkb(
cString, srs.cval, &newGeom.cval, C.int(bytes),
pabyData, srs.cval, &newGeom.cval, C.int(bytes),
).Err()
}

Expand Down Expand Up @@ -305,8 +305,8 @@ func (geom Geometry) Envelope() Envelope {

// Assign a geometry from well known binary data
func (geom Geometry) FromWKB(wkb []uint8, bytes int) error {
cString := (*C.uchar)(unsafe.Pointer(&wkb[0]))
return C.OGR_G_ImportFromWkb(geom.cval, cString, C.int(bytes)).Err()
pabyData := (unsafe.Pointer(&wkb[0]))
return C.OGR_G_ImportFromWkb(geom.cval, pabyData, C.int(bytes)).Err()
}

// Convert a geometry to well known binary data
Expand Down

0 comments on commit 9920f95

Please sign in to comment.