issue_comments
7 rows where issue = 98074194 and user = 1217238 sorted by updated_at descending
This data as json, CSV (advanced)
issue 1
- xray methods using shapefile as mask? · 7 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
378395920 | https://github.com/pydata/xarray/issues/501#issuecomment-378395920 | https://api.github.com/repos/pydata/xarray/issues/501 | MDEyOklzc3VlQ29tbWVudDM3ODM5NTkyMA== | shoyer 1217238 | 2018-04-03T20:54:21Z | 2018-04-03T20:54:21Z | MEMBER | @liyaojun have you tried the website http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/ ? It still works for me. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xray methods using shapefile as mask? 98074194 | |
146033284 | https://github.com/pydata/xarray/issues/501#issuecomment-146033284 | https://api.github.com/repos/pydata/xarray/issues/501 | MDEyOklzc3VlQ29tbWVudDE0NjAzMzI4NA== | shoyer 1217238 | 2015-10-06T23:29:40Z | 2015-10-06T23:29:40Z | MEMBER | Here's a notebook that includes a working example: https://gist.github.com/shoyer/0eb96fa8ab683ef078eb To get the facetted plot to work, you'll need to be running the development version of xray. |
{ "total_count": 4, "+1": 4, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xray methods using shapefile as mask? 98074194 | |
143904037 | https://github.com/pydata/xarray/issues/501#issuecomment-143904037 | https://api.github.com/repos/pydata/xarray/issues/501 | MDEyOklzc3VlQ29tbWVudDE0MzkwNDAzNw== | shoyer 1217238 | 2015-09-28T23:49:13Z | 2015-09-28T23:49:13Z | MEMBER | Hmm. My code does seem to have a bug when given a dataset with more than 2 dimensions. I'll see if I can fix this up and add it to the examples page on the docs. On Mon, Sep 28, 2015 at 4:20 PM, slharris notifications@github.com wrote:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xray methods using shapefile as mask? 98074194 | |
143120097 | https://github.com/pydata/xarray/issues/501#issuecomment-143120097 | https://api.github.com/repos/pydata/xarray/issues/501 | MDEyOklzc3VlQ29tbWVudDE0MzEyMDA5Nw== | shoyer 1217238 | 2015-09-25T04:14:50Z | 2015-09-25T04:14:50Z | MEMBER | @slharris I think you need to modify your second to last line like so:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xray methods using shapefile as mask? 98074194 | |
143021718 | https://github.com/pydata/xarray/issues/501#issuecomment-143021718 | https://api.github.com/repos/pydata/xarray/issues/501 | MDEyOklzc3VlQ29tbWVudDE0MzAyMTcxOA== | shoyer 1217238 | 2015-09-24T19:08:36Z | 2015-09-24T19:08:36Z | MEMBER | @slharris I just updated the earlier example to show how to use where for masking. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xray methods using shapefile as mask? 98074194 | |
126461466 | https://github.com/pydata/xarray/issues/501#issuecomment-126461466 | https://api.github.com/repos/pydata/xarray/issues/501 | MDEyOklzc3VlQ29tbWVudDEyNjQ2MTQ2Ng== | shoyer 1217238 | 2015-07-30T20:00:44Z | 2015-09-24T19:07:58Z | MEMBER |
``` python import geopandas from rasterio import features from affine import Affine def transform_from_latlon(lat, lon): lat = np.asarray(lat) lon = np.asarray(lon) trans = Affine.translation(lon[0], lat[0]) scale = Affine.scale(lon[1] - lon[0], lat[1] - lat[0]) return trans * scale def rasterize(shapes, coords, fill=np.nan, kwargs): """Rasterize a list of (geometry, fill_value) tuples onto the given xray coordinates. This only works for 1d latitude and longitude arrays. """ transform = transform_from_latlon(coords['latitude'], coords['longitude']) out_shape = (len(coords['latitude']), len(coords['longitude'])) raster = features.rasterize(shapes, out_shape=out_shape, fill=fill, transform=transform, dtype=float, kwargs) return xray.DataArray(raster, coords=coords, dims=('latitude', 'longitude')) this shapefile is from natural earth datahttp://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/states = geopandas.read_file('/Users/shoyer/Downloads/ne_10m_admin_1_states_provinces_lakes') us_states = states.query("admin == 'United States of America'").reset_index(drop=True) state_ids = {k: i for i, k in enumerate(us_states.woe_name)} shapes = [(shape, n) for n, shape in enumerate(us_states.geometry)] ds = xray.Dataset(coords={'longitude': np.linspace(-125, -65, num=5000), 'latitude': np.linspace(50, 25, num=3000)}) ds['states'] = rasterize(shapes, ds.coords) example of applying a maskds.states.where(ds.states == state_ids['California']).plot() ``` Once you have the rasterized geometries, you can use them as arrays to do arithmetic: https://github.com/xray/xray/issues/503 When we figure out how to represent coordinate reference systems properly in xray we might add in a direct wrapper for some of these rasterio functions. |
{ "total_count": 8, "+1": 8, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xray methods using shapefile as mask? 98074194 | |
128222506 | https://github.com/pydata/xarray/issues/501#issuecomment-128222506 | https://api.github.com/repos/pydata/xarray/issues/501 | MDEyOklzc3VlQ29tbWVudDEyODIyMjUwNg== | shoyer 1217238 | 2015-08-06T02:58:43Z | 2015-08-06T02:58:43Z | MEMBER | We'll probably release v0.6 in several weeks, once we have the key functionality we want for new the plotting module. On Wed, Aug 5, 2015 at 7:24 PM, slharris notifications@github.com wrote:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xray methods using shapefile as mask? 98074194 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 1