Доступ файл ".csv" для карты наркопреступленний
Здравствуйте всем--я студент, мы с коллегами на медицинском факультете в университете Джонс-Хопкинса работаем над проектом по эпидемиологической ситуации ВИЧ в РФ. Развитие ситуации связано с наркотиками, а мы используемся карты в программе ArcMap, чтобы описать аспекты самой ситуации.
Мы с коллегами ищем файл ".csv" для карты наркопреступлений 2014 г., показана в этой ссылке: http://atlasjustice.com/drugmap/region.html# .
Такой ".csv" используется в программе "ArcMap". Мы хотим знать, если этот файл существует, а если есть общий доступ к файлу. Спасибо большое за ваше внимание.
С уважением,
Джордж Охара
Ответ
Dear George
Thank you for your interest in our project. Please be advised that the (region-level) data can be furnished through an SQL-flavoured API in JSON (which is then easily convertible into CSV): https://enforce.carto.com/api/v2/sql?q=SELECT mvdcode, oktmo, region, regioneng, drcrsmvd, drcrsfns, drcrs, kndrcrs, mvdvp10, mvdvp20, mvdvp30, mvdvp40, mvdvp50, mvdvp60, mvdvp70, mvdvp80, mvdvp90, fnsvp10, fnsvp20, fnsvp30, fnsvp40, fnsvp50, fnsvp60, fnsvp70, fnsvp80, fnsvp90, cn_amph, cn_anab, cn_cann, cn_deso, cn_othe, cn_ecst, cn_hero, cn_coca, cn_popp, cn_opio, cn_sibu, cn_scan, region_pop, drshmvd, drshfns, drmoder, modmvdr, modmvde, modfnsr, modfnse, prctoverla FROM drug_reg
If you have other questions don't hesitate to contact us via email.
Best
Dmitriy
Hello Dmitriy, thank you for providing this data link. Is the data also convertible into SHP (shapefile for use in ArcMap)?
Alternatively, I have converted the API to CSV and am now trying to convert the CSV into SHP using FME software, and I would like to know what the following attributes stand for (I realize some concern МВД data but am not entirely sure what they correspond to):
mvdvp10, mvdvp20, mvdvp30 (...) mvdvp90
fnsvp10 (...) fnsvp90
drshmvd
drshfns
prctoverla
My other question is that I am trying to convert non-spatial data (CSV) that you provided into spatial data, but for all attributes (mvdcode, oktmo, etc.), the data type is string. I am somewhat new to data mapping and I was hoping to find attributes that can be converted to x- and y- coordinate data types, to place each federal subject in a spatial data arrangement (map of RF). For each federal subject, I am unsure of which attributes represent coordinates or position--is this spatial information contained in the API? Please let me know. Thank you!
Best,
George O'Hara
Dear George
First, I could suggest reading up a bit on shapefile data structure. Apart from the .shp (geometry file) it contains information on projection (.prj) and the data (.dbf), inter alia. The API now returns the data contained in the DBF, not the geometry. For geometry you can use any Russian region admin1 shapefile (say, from GADM) and then merge the data you got from the API (represented as the new DBF) on appropriately prepared region field with your geometry. Any GIS software in capable of that.
On attribute disambiguation: since the API is undocumented I suggest you reverse-engineer it — open one region on the map and look for the same values in corresponding API return for this region. That will give you an idea on what variables stand for.
On variable types: it's easily fixable in any statistical package (say, in R: v <- as.integer(v)).
Best
Dmitriy
Hello again Dmitriy, thank you for this help.
I tried reverse-engineering by opening regions on the map and looked for matching values in corresponding API but could not find matches for the attributes I listed above.
Since you kindly provided the API, is the .prj for the map also available?
Thank you,
George
Dear George
mvdvp10 et al. are from percentile chart on the second tab of the infowindow.
On .prj — again, I can only suggest you familiarise yourself with shapefiles more. This file is related to your geometry, not the .dbf. So, I am afraid it is pointless to provide this file for you as it merely describes the chosen geometry.
Best
Dmitriy
Dear Dmitriy,
The link you give provides data on regional level, but I am interested in municipal level. Could you provide link for this too?
Also,is it possible to obtain information about total money volume of drugs expropriated through api?
Thank you,
Georgiy
Dear Georgiy
thank you for your inquiry. To get district-level data simply replace drug_reg with drug_distr: https://enforce.carto.com/api/v2/sql?q=SELECT name, nameeng, oktmo, osm_id, region, regioneng, cn_amph, cn_anab, cn_cann, cn_coca, cn_deso, cn_ecst, cn_hero, cn_opio, cn_othe, cn_popp, cn_scan, cn_sibu, drcrs, kndrcrs, meddrv, valp10, valp20, valp30, valp40, valp50, valp50, valp60, valp70, valp80, valp90 FROM drug_distr
Best regards
Dmitriy
Сервис поддержки клиентов работает на платформе UserEcho
Dear George
Thank you for your interest in our project. Please be advised that the (region-level) data can be furnished through an SQL-flavoured API in JSON (which is then easily convertible into CSV): https://enforce.carto.com/api/v2/sql?q=SELECT mvdcode, oktmo, region, regioneng, drcrsmvd, drcrsfns, drcrs, kndrcrs, mvdvp10, mvdvp20, mvdvp30, mvdvp40, mvdvp50, mvdvp60, mvdvp70, mvdvp80, mvdvp90, fnsvp10, fnsvp20, fnsvp30, fnsvp40, fnsvp50, fnsvp60, fnsvp70, fnsvp80, fnsvp90, cn_amph, cn_anab, cn_cann, cn_deso, cn_othe, cn_ecst, cn_hero, cn_coca, cn_popp, cn_opio, cn_sibu, cn_scan, region_pop, drshmvd, drshfns, drmoder, modmvdr, modmvde, modfnsr, modfnse, prctoverla FROM drug_reg
If you have other questions don't hesitate to contact us via email.
Best
Dmitriy