Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw Value serializer output json string for Spatial type #856

Closed
wants to merge 1 commit into from

Conversation

xuzhg
Copy link
Member

@xuzhg xuzhg commented Jun 27, 2017

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
Copy link
Member Author

xuzhg commented Jul 4, 2017

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.

None yet

3 participants