POST
|
OK, Xander, caipirinhas it is. Yes you are right, the municipalities are pretty small, although some are huge. I'm annexing the layer file with the municipalities. So far I figured out I can use the Sample—Help | ArcGIS for Desktop tool if with centroid points made of each polygon. The data seems to be fine, and one option would be to get one raster for each statistics (either that or the 12 months and I can do the statistics later), use Sample with points and this set of rasters, and then repeat that for each year. Too bad though the Sample command doesn't let me capture the code of each municipality (variable CD_GEOCMU in the point layer). Alternatively to the centroid point, I can get the coordinates from each city town hall, which are made available by the Brazilian Institute of Geography and Statistics. But I think ideally, because of the larger municipalities, getting the data from rasters to polygons would be better. To that end I tried the Extract Values To Table—Help | ArcGIS Desktop tool, but the data doesn't seem to fit. One municipality is inside a raster with a ~110 mean precipitation and it comes out with ~142 in the table using Extract Values to Table. I'm checking it with the OID* and FID* identifiers from both tables, though I'm not sure they are exactly the same and I could be seeing another municipality (ideally I would like to CD_GEOCMU be used as the identifier variable...). I'm wondering how these tools weight the data though - if a raster cover 40% of the polygon and another covers 60%, will the mean precipitation be the weighted mean of these two rasters? So these were the two things I tried so far, Sample worked alright for points, EVTT didn't for polygons. The first-best scenario would be getting it from polygons due to big municipalities. Also, for the data, I'm not sure it is available on a yearly basis - I'm using this dataset because I saw it being used in an economics paper concerning rainfall and child birth in the Brazilian semi-arid. Also, the precipitation variables are to be used as controls in a regression, so they don't need to be exactly perfect, just need to show the heterogeneity in rainfall between municipalities. As I use panel data, that's why I need data on the 19 years. I'm sending a .lyr file since the .shp was too big to annex.
... View more
07-21-2017
10:36 AM
|
0
|
6
|
778
|
POST
|
Holy Xander, I'm speechless. Can't find words to thank you enough. I've tested and it worked, added the other years from the dataset (so now I get 1996-2014). I only have one last question though; my final objective is to gather data on precipitation for a given Brazilian municipality i in year t. I have two elements: a) points with attributes on monthly precipitation, as well as summary statistics (and which can be turned to rasters with Point to Raster feature), b) a layer composed of polygons, each one representing the area of a given Brazilian municipality, with an attribute table that includes the code of each municipality. How can I get the data on the rasters (which I can get from the points, as you said above) to the municipalities (polygons), so I get a final table with the code of each municipality and the data on precipitation? Also, as I have noticed from the Point to Raster tool, I need to choose one attribute from the points to become the raster - is it possible I can get all the monthly temperatures to a municipality, not just the mean, or the max/min, each at a time? And is there an easy way to do it for all the 19 years (96-14)? Is it possible to use polygons or should I get the point of the centroid of each municipality and use the Extract Values to Points tool? Thanks to Dan Patterson as well and to you. If ever in Brazil, I owe you guys some drinks. Or at least a feijoada. Cheers!
... View more
07-20-2017
07:29 PM
|
0
|
8
|
778
|
POST
|
Wait now I'm lost again. I got the precip.1996 file, renamed it to .txt, them opened it with Excel. I choose a delimited-space option and then it opened as a regular spreadsheet. I added the header in the Excel cells and then saved the file again in a .txt format. I see now that it saved a a tab-delimited text data whereas I wish it was space-delimited. I used this Esri ASCII raster format—Help | ArcGIS for Desktop as the example for the ASCII header. So what should I exactly do and how do I get an example of the ASCII header? Sorry for taking your time... Edit: I just tried two things: a) opening the file in excel, no header, just saved it as a .csv file. Them I could add as a X, Y layer but all the data were points. I exported the data inside ArcMap but as they were points, I think it is kind of useless, right? b) opening the file in excel, adding the header, saved it as a .csv file. Opened word, replaced all ";" by spaces " ", and saved it as a .txt. So now it was a space-delimited text file with a header according to ArcGis specs. I tried using ASCII to Raster with this space-delimited text file but got the error 010328 (syntax error at or near symbol SPACE) and 010267 (syntax error in parsing grid expression). And only now I realized the fishnet thing you were talking about. Got to take a look into that. So if I get points like I did in a), I can make them cells, that's it right? I just wonder why inputting the header like I did in b) didn't work... *As for the website, all I get in the README files is a technical description of the data and this is in the header of the downloads page: "Important note: all files available here for downloading have been "compressed" under Unix in order to save space. A single compressed file has ".Z" extension. You may need to respecify the ".Z" extension when you save a compressed file. Some of our archives also have multiple files (such as time series) that are "tar"ed under Unix and have a ".tar" extension. As a result, files must be "untared" and/or "uncompressed" to return them to their original ASCII format, before they may be used. How to cite our data: we recommend that users cite pertinent information contained in the README files associated with the data sets. A citation should contain the creators' (our) names and the creation and/or most-recent-modification date, as well as the title and URL associated with the data set. An example of how to cite one of our data sets is: Willmott, C. J. and K. Matsuura (2001) Terrestrial Air Temperature and Precipitation: Monthly and Annual Time Series (1950 - 1999), http://climate.geog.udel.edu/~climate/html_pages/README.ghcn_ts2.html. Please change the content accordingly."
... View more
07-20-2017
09:51 AM
|
0
|
0
|
1285
|
POST
|
Wow Dan that was probably the solution... I'm trying it out but could you aid me with 2 more things? First, I know obviously the number of cells and columns and the nodata_value; but I'm not pretty sure I understood the other 3 criteria: XLLCENTER/XLLCORNER, YLLCENTER/YLLCORNER and CELLSIZE. I read that in the XLL/YLL cell I must input the southwesternmost cell in my file, which would be -179,250/-89,75. The cellsize area, according to the README file, is 0,5 degrees. So I inputed the following header: NCOLS 18 NROWS 85800 XLLCORNER -179.75 YLLCORNER -89.75 CELLSIZE 0.5 NODATA_VALUE -9999 But, when opening in ArcMap by adding XY, it won't let me choose the right X and Y columns (which would be columns 1 and 2, respectively). The option only starts at column 3. I tried to move all the cells two units to the right; but again it would only let me choose from column 5 onwards. Any idea of why this is happening? Second thing: I want to add some statistics (mean, max, min, and the coef. of variation). Should I add them in Excel already or can it be problematic? The final use of the data is: I have polygons representing each brazilian municipality and I want to translate the data from the raster to each municipality. But anyway I think that once I figure that out it's gonna work. Thanks Dan, you've been wonderful.
... View more
07-20-2017
09:27 AM
|
0
|
2
|
1285
|
POST
|
Ok Dan I'm home right now so I can provide you with better answers. Beginning with the text file, I saw the help file in ArcMap help and it doesn't seem like it begins with this header of information. Actually, the lines are coordinate points (I've pasted the first line on the bottom of this reply). When I try to open this .txt with Ascii to Raster, I get errors: 010328: Syntax error at or near symbol SPACE 010267: Syntax error in parsing grid expression When I try to open with Add Data, I get this: Either way the "original" .1996, .1997 format and so on does not enable any add option. So I really think it must be a .txt file, just need to figure out how to get ArcMap to read it, right? P.S. First line: -179.750 71.250 5.7 7.9 9.6 7.2 14.0 15.6 26.0 21.5 12.9 13.9 20.3 5.0 -179.750 68.750 8.0 4.8 10.5 7.3 4.9 14.6 59.0 55.5 8.9 28.3 27.3 4.8 -179.750 68.250 12.2 8.7 16.9 7.5 8.9 20.7 60.4 54.9 9.9 28.1 32.4 10.8 -179.750 67.750 19.8 16.6 33.6 7.8 16.9 33.9 68.5 57.4 13.5 28.1 46.4 22.2 -179.750 67.250 29.6 27.2 62.1 7.1 28.2 52.4 79.4 58.7 21.4 30.5 73.5 38.0 -179.750 66.750 30.2 33.1 94.5 1.2 42.3 72.6 95.2 62.3 36.8 35.7 105.2 47.1 -179.750 66.250 25.1 33.5 108.3 0.0 53.1 86.2 114.9 71.7 49.3 39.9 116.6 48.0 -179.750 65.750 30.3 32.5 85.4 0.0 39.2 65.0 87.3 72.6 33.4 26.8 86.2 40.0 -179.750 65.250 43.0 32.2 67.3 3.0 29.0 44.6 62.4 76.0 19.8 20.7 65.5 38.2 -179.75
... View more
07-19-2017
06:11 PM
|
0
|
4
|
1285
|
POST
|
Hey Dan, how you doing? Thanks again for reaching out to help me. On the official website it says they're ASCII data files. When I use Ascii to Raster, however, ArcMap reports an instant failure. Even when I renamed the .1996 (and so on) files to .txt they still report the same error. Curiously though, the .txt file can be open in Notepad and displays values that seem proper for ArcGIS. I'm not home right now so I can't report the exact error reported by Ascii to Raster; I'll post an update with the error term later. Thanks again and have a good day
... View more
07-19-2017
10:26 AM
|
0
|
6
|
1285
|
POST
|
Hello folks, I'm in a kind of bad situation and just couldn't find any solution. So I'm trying to open the "Willmott, C. J. and K. Matsuura (2001) Terrestrial Air Temperature and Precipitation: Monthly and Annual Time Series (1950 - 1999)" dataset, which is avaiable in this link, but I just can't do it on ArcMap. I downloaded 7Zip to un-tar the file (it comes as .tar), but even after uncompressed, each year comes in a .1996, .1997, .1998 and so on format. This leaves me no clue on how to open them in ArcMap. I am annexing the files so you can take a look. I really found no way to open them online, I even tried just renaming to a .nc file and them opening with one of the tools in ArcMap, but it just didn't work. Also, I tried to rename them to a .txt format and then just add them to ArcMap. Also didn't work - it was added as an attribute table but it crashed upon opening. If anyone knows how I can import those files to ArcMap, I'd be very thankful. Cheers, Joao
... View more
07-18-2017
08:57 PM
|
1
|
18
|
3222
|
POST
|
Hello, I have a shapefile for a coastline, I have the boundaries and centroid points for municipalities. I created a measure of "Distance to coastline" but I also would like to know if a city area is in contact with the coast or not. I attempted to find it online but did not come up with anything. Any ideas? Thanks, João
... View more
05-01-2017
09:00 AM
|
0
|
2
|
570
|
POST
|
Hello Dan, thank you very much, I had no idea it was that straightforward... If I may ask for another piece of help, I'm having trouble generating the NearTable in kilometers. I have two layers - the center of the municipalities and the missions - and the results were on a unit that I think was decimal degrees - small numbers between 0 and 3. Reading some threads online I have set both on the South America Albers Conic Area PCS. My points then moved to southern Uruguay, and I put them back to SIRGAS 2000 (their original GCS). So how do I obtain my results in kilometers? Thank you in advance
... View more
04-03-2017
05:42 PM
|
0
|
1
|
715
|
POST
|
Hello dear ArcGIS programmers, I have a dataset with points on the center of municipalities in south Brazil. I have also a set of coordinates that are approximate locations of Jesuit Missions. I need to find the closest distance a municipality is from a mission, aka the minimum distance. I tried using MultiPoint to create a set of points and then use distance from that to obtain the minimum distance. Using syntax example I found online I didn't had much luck but to end in tears. import arcpy # A list of features and coordinate pairs feature_info = [[[-50.963, -25.596], [-51.367, -25.191], [-54.353, -25.464], [-53.243, -28.28]], [[-52.074, -22.597], [-50.463, -24.942], [-51.9, -22.69], [-51.689, -25.679]], [[-51.689, -25.679], [-50.737, -24.489], [-50.975, -23,716], [-54.965, -28.2]], [[-54.296, -28.512], [-53.899, -28.611], [-53.677, -28.538],[-55.959, -28.783]], [[-53.15, -28.015], [53.243, -28.28], [-55.171, -27.776], [54.793, 27.485], [54.621, 27.478]]] # A list that will hold each of the Multipoint objects features = [] for feature in feature_info: # Create a Multipoint object based on the array of points # Append to the list of Multipoint objects arcpy.Multipoint(feature) As you can see, I wasn't even including the distance function in this example. If anyone can help me with the distance calculation, I would surely appreciate. It's been a while since I started using ArcGIS for this only purpose and so far only managed to create a central point for every municipality.
... View more
04-02-2017
06:25 PM
|
0
|
3
|
1668
|
Title | Kudos | Posted |
---|---|---|
1 | 07-18-2017 08:57 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|