Opened 11 years ago

Closed 11 years ago

#621 closed enhancement (fixed)

geos_c api string handling improvements

Reported by: danielzeitlin Owned by: strk
Priority: major Milestone: 3.3.9
Component: C API Version: 3.3.7
Severity: Significant Keywords:
Cc: danielzeitlin

Description

GEOSWKBReader_read_r() method copies the given WKB string two times instead of directly access it without any copy
first copy --> std::string wkbstring(wkb, size);
second copy --> is.str(wkbstring);

similar one copy occurs in GEOSWKBWriter_write_r() method.

These two methods are very important since are main entry points for geometry de/serialization between libraries using GEOS (GDAL uses them two).

I fixed these methods and attached a short patch file. Consider to fix WKT read/write too.

Attachments (1)

geos_ts_c.cpp.patch (1.6 KB ) - added by danielzeitlin 11 years ago.

Download all attachments as: .zip

Change History (4)

by danielzeitlin, 11 years ago

Attachment: geos_ts_c.cpp.patch added

comment:1 by danielzeitlin, 11 years ago

Cc: danielzeitlin added
Component: DefaultC API
Owner: changed from geos-devel@… to pramsey

comment:2 by strk, 11 years ago

Owner: changed from pramsey to strk
Status: newassigned

comment:3 by strk, 11 years ago

Resolution: fixed
Status: assignedclosed

r3779 for trunk / r3780 for 3.3 branch. If you send a patch for WKT read/write it'll be applied.

Note: See TracTickets for help on using tickets.