@@ -18,7 +18,7 @@ use std::cell::RefCell;
1818
1919use byteorder:: { BigEndian , ByteOrder , LittleEndian } ;
2020use geo_traits:: * ;
21- use geos:: GResult ;
21+ use geos:: { CoordType , GResult } ;
2222use wkb:: { reader:: * , Endianness } ;
2323
2424/// A factory for converting WKB to GEOS geometries.
@@ -215,11 +215,11 @@ fn create_coord_sequence_from_raw_parts(
215215 num_coords : usize ,
216216 scratch : & mut Vec < f64 > ,
217217) -> GResult < geos:: CoordSeq > {
218- let ( has_z , has_m , dim_size) = match dim {
219- Dimension :: Xy => ( false , false , 2 ) ,
220- Dimension :: Xyz => ( true , false , 3 ) ,
221- Dimension :: Xym => ( false , true , 3 ) ,
222- Dimension :: Xyzm => ( true , true , 4 ) ,
218+ let ( coord_type , dim_size) = match dim {
219+ Dimension :: Xy => ( CoordType :: XY , 2 ) ,
220+ Dimension :: Xyz => ( CoordType :: XYZ , 3 ) ,
221+ Dimension :: Xym => ( CoordType :: XYM , 3 ) ,
222+ Dimension :: Xyzm => ( CoordType :: XYZM , 4 ) ,
223223 } ;
224224 let num_ordinates = dim_size * num_coords;
225225
@@ -233,7 +233,7 @@ fn create_coord_sequence_from_raw_parts(
233233 {
234234 let coords_f64 =
235235 unsafe { & * core:: ptr:: slice_from_raw_parts ( ptr as * const f64 , num_ordinates) } ;
236- geos:: CoordSeq :: new_from_buffer ( coords_f64, num_coords, has_z , has_m )
236+ geos:: CoordSeq :: new_from_buffer ( coords_f64, num_coords, coord_type )
237237 }
238238
239239 // On platforms without unaligned memory access support, we need to copy the data to the
@@ -249,7 +249,7 @@ fn create_coord_sequence_from_raw_parts(
249249 scratch. as_mut_ptr ( ) as * mut u8 ,
250250 num_ordinates * std:: mem:: size_of :: < f64 > ( ) ,
251251 ) ;
252- geos:: CoordSeq :: new_from_buffer ( scratch. as_slice ( ) , num_coords, has_z , has_m )
252+ geos:: CoordSeq :: new_from_buffer ( scratch. as_slice ( ) , num_coords, coord_type )
253253 }
254254 }
255255 } else {
@@ -262,7 +262,7 @@ fn create_coord_sequence_from_raw_parts(
262262 save_f64_to_scratch :: < LittleEndian > ( scratch, buf, num_ordinates) ;
263263 }
264264 }
265- geos:: CoordSeq :: new_from_buffer ( scratch. as_slice ( ) , num_coords, has_z , has_m )
265+ geos:: CoordSeq :: new_from_buffer ( scratch. as_slice ( ) , num_coords, coord_type )
266266 }
267267}
268268
0 commit comments