package com.qiyou.mb.android.beans.basic;

import android.text.TextUtils;

public class GEOaddress {

public GEOaddress(){
	
} 
private String cityId; //bd geo cityId
private String province;
private String city;
private String district;
private String street;
private String streetNo;
private Media GEOpic;
private float lat;
private float lon;
private String address;
private String name;


public GEOaddress( GEO_bean geo){
	if(geo==null)return;
	province =geo.getProName();
	city=geo.getCityName();
	street =geo.getStreetName();
	streetNo=geo.getName();
}


public Media getGEOpic() {
	return GEOpic;
}

public void setGEOpic(Media gEOpic) {
	GEOpic = gEOpic;
}
public String getProvince() {
	return province;
}
public void setProvince(String province) {
	this.province = province;
}
public String getCity() {
	return city;
}
public void setCity(String city) {
	this.city = city;
}
public String getDistrict() {
	return district;
}
public void setDistrict(String district) {
	this.district = district;
}
public String getStreet() {
	return street;
}
public void setStreet(String street) {
	this.street = street;
}
public String getStreetNo() {
	return streetNo;
}
public void setStreetNo(String streetNo) {
//	if(TextUtils.isEmpty(streetNo))
//		streetNo ="未知地点";
	this.streetNo = streetNo;
}
public String toString(GEOaddress geo,String split){
	
	String address ="";
 
	if(!TextUtils.isEmpty(province) && !TextUtils.isEmpty(geo.getProvince()) &&  province.equalsIgnoreCase(geo.getProvince()) ){
		
		if(!TextUtils.isEmpty(city) && !TextUtils.isEmpty(geo.getCity()) &&  city.equalsIgnoreCase(geo.getCity()) ){
			if(!TextUtils.isEmpty(district) && !TextUtils.isEmpty(geo.getDistrict()) &&  district.equalsIgnoreCase(geo.getDistrict()) ){
				if(!TextUtils.isEmpty(street))
					address =address + street + " ";
				
				if(!TextUtils.isEmpty(streetNo))
					address =address + streetNo;
			}else{
				if(!TextUtils.isEmpty(district))
					address =address+ district + split;
			}
				
		}else{ //not same city
			if(!TextUtils.isEmpty(city))
				address =address+ city + split;
		 
			if(!TextUtils.isEmpty(district))
				address =address + district+ split;
			
			if(!TextUtils.isEmpty(street))
				address =address + street + " ";
			
			if(!TextUtils.isEmpty(streetNo))
				address =address + streetNo;
			
		}
			
		
	}else{ //not same province
		
		if(!TextUtils.isEmpty(province))
			address =address+ province + split; 
	
	if(!TextUtils.isEmpty(city))
		address =address+ city + split;
	
	if(!TextUtils.isEmpty(district))
		address =address + district+ split;
	
	if(!TextUtils.isEmpty(street))
		address =address + street + " ";
	
	if(!TextUtils.isEmpty(streetNo))
		address =address + streetNo;
	}
	return address;
}

public String toString(String split){
	
	String address ="";
	if(!TextUtils.isEmpty(province))
		address =address+ province + split;
	
	if(!TextUtils.isEmpty(city))
		address =address+ city + split;
	
	if(!TextUtils.isEmpty(district))
		address =address + district+ split;
	
	if(!TextUtils.isEmpty(street))
		address =address + street + " ";
	
	if(!TextUtils.isEmpty(streetNo))
		address =address + streetNo;
	
	if(TextUtils.isEmpty(name))	
	return address;
	else{
		return name+"\n" +address;
	}
}

public String getCityId() {
	return cityId;
}

public void setCityId(String cityId) {
	this.cityId = cityId;
}

public float getLat() {
	return lat;
}

public void setLat(float lat) {
	this.lat = lat;
}

public float getLon() {
	return lon;
}

public void setLon(float lon) {
	this.lon = lon;
}

public String getName() {
	return name;
}

public void setName(String name) {
	this.name = name;
}

public String getAddress() {
	return address;
}

public void setAddress(String address) {
	this.address = address;
}



}
