GribApiDotNet / GribApi.NET

A powerful .NET library for reading and writing GRIB 1 and 2 files
Apache License 2.0
54 stars 28 forks source link

Signed boundary latitude/longitude values #95

Open muteebali opened 6 years ago

muteebali commented 6 years ago

@jnyrup @0x1mason Is there any way to find out the signed(+/-) boundary values of latitude/longitude. As before, i am trying to extract values from key value pair i.e. startingLatitude, startingLongitude, lastLatitude, lastLongitude but in each case i get positive(+) values. For South and West, values should be negative. Can you suggest any way, I need to draw boundary using these values.

jnyrup commented 6 years ago

What are the minimum and maximum values of {starting, last}{latitude, longitude}? I have seen data providers represent longitude in either [-180;180) or [0;360). The few datasets I have been working with have always represented latitude in [-90;90], but maybe yours is in [0;180]?

I just had a look at https://software.ecmwf.int/wiki/display/ECC/ecCodes+version+2.5.0+released and there seems to be several fixes for lat/long.

muteebali commented 6 years ago

@jnyrup

  1. We are getting these values in meta data of records.
  2. Longitude values are not being incremented correctly, go outside of the range.
  3. I am using GribApi.NET 1.0.0-beta4, is this version using ecCodes 2.5.0? if not then how can we add support for ecCodes 2.5.0 in GribApi.NET 1.0.0-beta4 source code?
jnyrup commented 6 years ago

GribApi.NET 1.0.0-beta4 uses ecCodes 2.4.1. I haven't successfully built GribApi.NET from scratch myself, but here are some observations:

0x1mason commented 6 years ago

In GRIB 2, longitude is 0-360. In GRIB 1 It's -180 to 180. It's part of the spec. You can determine how to offset by checking the edition.

On Dec 18, 2017 4:42 AM, "muteebali" notifications@github.com wrote:

@jnyrup https://github.com/jnyrup @0x1mason https://github.com/0x1mason Is there any way to find out the signed(+/-) boundary values of latitude/longitude. As before, i am trying to extract values from key value pair i.e. startingLatitude, startingLongitude, lastLatitude, lastLongitude but in each case i get positive(+) values. For South and West, values should be negative. Can you suggest any way, I need to draw boundary using these values.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/0x1mason/GribApi.NET/issues/95, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX_-7_TDAz1anJkTXV1qXPSbOreaBVDks5tBjNngaJpZM4RFM1g .

muteebali commented 6 years ago

@0x1mason I am using this file 20171215054150.zip In this case, i am getting out of range (Inappropriate) latitude values. Here is the code,

using(var grib=new GribFile(filePath)) { foreach(var record in grib) { //Here my logic to store extracted data } }

0x1mason commented 6 years ago

Can you provide a link to the originating center's grid definition?

0x1mason commented 6 years ago

This issue was moved to GribApiDotNet/GribApi.NET#1

muteebali commented 6 years ago

@0x1mason i am downloading GRIB files using third party tool ZYGRIB. Has this issue been resolved ?

muteebali commented 6 years ago

@jnyrup @0x1mason have you found any issue with above mentioned file ?