ee.FeatureCollection.style

একটি সহজ শৈলী ভাষা ব্যবহার করে ভিজ্যুয়ালাইজেশনের জন্য একটি ভেক্টর সংগ্রহ আঁকুন।

ব্যবহার রিটার্নস
FeatureCollection. style ( color , pointSize , pointShape , width , fillColor , styleProperty , neighborhood , lineType ) ছবি
যুক্তি টাইপ বিস্তারিত
এই: collection ফিচার কালেকশন সংগ্রহ আঁকা.
color স্ট্রিং, ডিফল্ট: "কালো" বৈশিষ্ট্য আঁকার জন্য একটি ডিফল্ট রঙ (CSS 3.0 রঙের মান যেমন, 'FF0000' বা 'লাল')। অস্বচ্ছতা সমর্থন করে (যেমন, 50% স্বচ্ছ লালের জন্য 'FF000088')।
pointSize পূর্ণসংখ্যা, ডিফল্ট: 3 বিন্দু চিহ্নিতকারীর পিক্সেলে ডিফল্ট আকার।
pointShape স্ট্রিং, ডিফল্ট: "বৃত্ত" প্রতিটি পয়েন্ট অবস্থানে আঁকার জন্য চিহ্নিতকারীর ডিফল্ট আকৃতি। এর মধ্যে একটি: `বৃত্ত`, `বর্গাকার`, `হীরা`, `ক্রস`, `প্লাস`, `পেন্টাগ্রাম`, `হেক্সাগ্রাম`, `ত্রিভুজ`, `ত্রিভুজ_উপর`, `ত্রিভুজ_নিচে`, `ত্রিভুজ_বাম`, `ত্রিভুজ_ডান`, `পেন্টাগন`, `ষড়ভুজ`, `6 তারা। এই যুক্তিটি এই Matlab মার্কার সংক্ষিপ্ত রূপগুলিকেও সমর্থন করে: `o`, `s`, `d`, `x`, `+`, `p`, `h`, `^`, `v`, `<`, `>`।
width ফ্লোট, ডিফল্ট: 2 রেখার ডিফল্ট লাইন প্রস্থ এবং বহুভুজ এবং বিন্দু আকৃতির জন্য রূপরেখা।
fillColor স্ট্রিং, ডিফল্ট: নাল বহুভুজ এবং বিন্দু আকার পূরণ করার জন্য রঙ। 0.66 অপাসিটিতে ডিফল্ট 'রঙ'।
styleProperty স্ট্রিং, ডিফল্ট: নাল একটি প্রতি-বৈশিষ্ট্য বৈশিষ্ট্য একটি অভিধান ধারণ করার প্রত্যাশিত৷ অভিধানের মানগুলি সেই বৈশিষ্ট্যের জন্য যেকোনো ডিফল্ট মানকে ওভাররাইড করে।
neighborhood পূর্ণসংখ্যা, ডিফল্ট: 5 যদি styleProperty ব্যবহার করা হয় এবং যেকোনো বৈশিষ্ট্যের পয়েন্ট সাইজ বা প্রস্থ ডিফল্টের চেয়ে বড় থাকে, তাহলে টাইলিং আর্টিফ্যাক্ট ঘটতে পারে। যেকোনো বৈশিষ্ট্যের জন্য প্রয়োজনীয় সর্বাধিক আশেপাশের (পয়েন্ট সাইজ + প্রস্থ) নির্দিষ্ট করে।
lineType স্ট্রিং, ডিফল্ট: "সলিড" বহুভুজ এবং বিন্দু আকারের লাইন এবং রূপরেখার জন্য ডিফল্ট লাইন শৈলী। ডিফল্ট 'সলিড'। এর মধ্যে একটি: কঠিন, ডটেড, ড্যাশড।

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
            .filter('country_lg == "Belgium"');

// Paint FeatureCollection to an image using collection-wide style arguments.
var fcVis = fc.style({
  color: '1e90ff',
  width: 2,
  fillColor: 'ff475788',  // with alpha set for partial transparency
  lineType: 'dotted',
  pointSize: 10,
  pointShape: 'circle'
});

// Display the FeatureCollection visualization (ee.Image) on the map.
Map.setCenter(4.326, 50.919, 9);
Map.addLayer(fcVis, null, 'Collection-wide style');

// Paint FeatureCollection to an image using feature-specific style arguments.
// A dictionary of style properties per power plant fuel type.
var fuelStyles = ee.Dictionary({
  Wind: {color: 'blue', pointSize: 5, pointShape: 'circle'},
  Gas: {color: 'yellow', pointSize: 6, pointShape: 'square'},
  Oil: {color: 'green', pointSize: 3, pointShape: 'diamond'},
  Coal: {color: 'red', pointSize: 3, pointShape: 'cross'},
  Hydro: {color: 'brown', pointSize: 3, pointShape: 'star5'},
  Biomass: {color: 'orange', pointSize: 4, pointShape: 'triangle'},
  Nuclear: {color: 'purple', pointSize: 6, pointShape: 'hexagram'},
});

// Add feature-specific style properties to each feature based on fuel type.
fc = fc.map(function(feature) {
  return feature.set('style', fuelStyles.get(feature.get('fuel1')));
});

// Style the FeatureCollection according to each feature's "style" property.
var fcVisCustom = fc.style({
  styleProperty: 'style',
  neighborhood: 8  // maximum "pointSize" + "width" among features
});

// Display the FeatureCollection visualization (ee.Image) on the map.
Map.addLayer(fcVisCustom, null, 'Feature-specific style');

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।

import ee
import geemap.core as geemap

Colab (পাইথন)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"'
)

# Paint FeatureCollection to an image using collection-wide style arguments.
fc_vis = fc.style(
    color='1e90ff',
    width=2,
    fillColor='ff475788',  # with alpha set for partial transparency
    lineType='dotted',
    pointSize=10,
    pointShape='circle',
)

# Display the FeatureCollection visualization (ee.Image) on the map.
m = geemap.Map()
m.set_center(4.326, 50.919, 9)
m.add_layer(fc_vis, None, 'Collection-wide style')

# Paint FeatureCollection to an image using feature-specific style arguments.
# A dictionary of style properties per power plant fuel type.
fuel_styles = ee.Dictionary({
    'Wind': {'color': 'blue', 'pointSize': 5, 'pointShape': 'circle'},
    'Gas': {'color': 'yellow', 'pointSize': 6, 'pointShape': 'square'},
    'Oil': {'color': 'green', 'pointSize': 3, 'pointShape': 'diamond'},
    'Coal': {'color': 'red', 'pointSize': 3, 'pointShape': 'cross'},
    'Hydro': {'color': 'brown', 'pointSize': 3, 'pointShape': 'star5'},
    'Biomass': {'color': 'orange', 'pointSize': 4, 'pointShape': 'triangle'},
    'Nuclear': {'color': 'purple', 'pointSize': 6, 'pointShape': 'hexagram'},
})

# Add feature-specific style properties to each feature based on fuel type.
fc = fc.map(
    lambda feature: feature.set('style', fuel_styles.get(feature.get('fuel1')))
)

# Style the FeatureCollection according to each feature's "style" property.
fc_vis_custom = fc.style(
    styleProperty='style',
    neighborhood=8,  # maximum "pointSize" + "width" among features
)

# Display the FeatureCollection visualization (ee.Image) on the map.
m.add_layer(fc_vis_custom, None, 'Feature-specific style')
m