Page MenuHomeFeedback Tracker

Allow Export Geodata tool to export splines as polylines
Feedback, NormalPublic

Description

The 'Export Geographic Data' tool currently cannot export splines at all.
A very simple tweak would make it possible to at least export them as polylines.

Details

Severity
Tweak
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General
Additional Information

SCR_ExportGeoJSONTool.c, line 462:

GeoShapeType shapeType = GeoShapeType.UNKNOWN;
if (classname == SCR_GeoExporter.POLYLINE_SHAPE_ENTITY)
{
	if (isClosed)
		shapeType = GeoShapeType.POLYGON;
	else
		shapeType = GeoShapeType.POLYLINE;
}

This code sets the shape type from UNKNOWN to POLYLINE / POLYGON, if the shape is a polyline. If the shape however is a spline, it will remain UNKNOWN and consequently, an the entry is not exported.
Instead, the surrounding if statement should be changed to this, or removed completely (since a previous if already checks this):

if (classname == SCR_GeoExporter.POLYLINE_SHAPE_ENTITY || classname == SCR_GeoExporter.SPLINE_SHAPE_ENTITY)

This simple change would allow modders to export their splines as polylines, which is usually close enough and always better than nothing.

Optionally, a warning about this could be added.

if (classname == SCR_GeoExporter.SPLINE_SHAPE_ENTITY) Print("Exporting spline shape as polyline!", LogLevel.WARNING);

Event Timeline

TilW created this task.Jun 11 2024, 3:31 PM
TilW renamed this task from Allow Export Geodata tool to export spline points as polylines to Allow Export Geodata tool to export splines as polylines.
Geez changed the task status from New to Feedback.Jun 11 2024, 4:16 PM