Simple GIS

GISプログラムの練習

credit

package stat2;


public class credit {
    
    String urlx,str;
     String data=new String[500000];
      String article=new String[500000];
     String name=new String[5000];
      String code=new String[5000];
      int datanumber,s,sx,number;
    
    void makedata(String id){
    
     urlx="http://statdb.nstac.go.jp/api/1.0b/app/getMetaInfo?appId=aeec3b02995623cad42b80c80f73d176b7c77970";
    urlx=urlx+"&statsDataId="+id;
    
    getdata sub2=new getdata();
    sub2.makedata(urlx);
    datanumber=sub2.datanumber;
    data=sub2.data;
    
    sx=0;
    for(s=1;s<datanumber+1;s++){
    if(data[s].indexOf("-1)sx=sx+1;
     if(data[s].indexOf("-1)article[sx]=data[s];
    }
    
    number=sx;
    
    int p1,p2;
    
    for(s=1;s<number+1;s++){
    str=article[s];
    p1=str.indexOf("code");
    p1=str.indexOf("\"",p1);
    p2=str.indexOf("\"",p1+1);  
    str=str.substring(p1+1,p2);
    code[s]=str;
    }
    
    for(s=1;s<number+1;s++){
    str=article[s];
    p1=str.indexOf("name");
    p1=str.indexOf("\"",p1);
    p2=str.indexOf("\"",p1+1);  
    str=str.substring(p1+1,p2);
    name[s]=str; 
    }
    
    
    
    
    }
}