Skip to content

Raw Value serializer output json string for Spatial type - #856

Closed
xuzhg wants to merge 1 commit into
OData:masterfrom
xuzhg:Bug846_RawValueForSpatial
Closed

xuzhg wants to merge 1 commit into
OData:masterfrom
xuzhg:Bug846_RawValueForSpatial

Conversation

@xuzhg

@xuzhg xuzhg commented Jun 27, 2017

Copy link
Copy Markdown
Contributor

Issues

Description

In RawValueWriter.cs, There's a function named WriteRawValue(object value), in which it has the following codes to write the Spatial object:

else if (value is Geometry || value is Geography)
{
   PrimitiveConverter.Instance.TryWriteAtom(value, textWriter);
}

However, it should call WriteJsonLight, not TryWriteAtom.

For example:

RawValueWriter target = new RawValueWriter(this.settings, this.stream, new UTF32Encoding());
var value2 = GeometryPoint.Create(1.2, 3.16);
target.WriteRawValue(value2);

Expected result

{"type":"Point","coordinates":[1.2,3.16],"crs":{"type":"name","properties":{"name":"EPSG:4326"}}}

Actual result

RID=4326;POINT (1.2 3.16)

Checklist (Uncheck if it is not completed)

  • [ x ] Test cases added
  • [ x ] Build and test with one-click build and test script passed

Additional work necessary

@xuzhg
xuzhg requested a review from mikepizzo June 27, 2017 16:12
@robward-ms robward-ms self-assigned this Jun 30, 2017
@xuzhg
xuzhg force-pushed the Bug846_RawValueForSpatial branch from 0cd9e9d to f49b05a Compare July 4, 2017 00:03
@xuzhg

xuzhg commented Jul 4, 2017

Copy link
Copy Markdown
Contributor Author

Merged at: f49b05a

@xuzhg xuzhg closed this Jul 4, 2017
@xuzhg
xuzhg deleted the Bug846_RawValueForSpatial branch October 19, 2018 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants